Skip to content

Commit 6b5916c

Browse files
authored
chore: bump version to 0.4.2 (#72)
Update version across all workspace crates and documentation. Changes: - Cargo.toml: version 0.4.1 → 0.4.2 (workspace + all crates) - Cargo.lock: Updated dependency versions - CHANGELOG.md: Add v0.4.2 entry with Telegram MarkdownV2 fix details - README.md: Security section improvements - Add Trivy badge (0 CVEs) - Add MSRV badge (1.88) - Expand Security section with detailed tables - Document 12 blocked shell patterns with risk categories - Add container security details (Oracle Linux 9, non-root user) - Add code security section (no unsafe, cargo-deny) - Update Docker version examples (v0.4.1 → v0.4.2) All 221 tests pass.
1 parent f5ffab9 commit 6b5916c

File tree

4 files changed

+95
-40
lines changed

4 files changed

+95
-40
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
## [0.4.2] - 2026-02-08
10+
11+
### Fixed
12+
- Telegram MarkdownV2 parsing errors (Issue #69). Replaced manual character-by-character escaping with AST-based event-driven rendering using pulldown-cmark 0.13.0
13+
- UTF-8 safe text chunking for messages exceeding Telegram's 4096-byte limit. Uses `str::is_char_boundary()` with newline preference to prevent splitting multi-byte characters (emoji, CJK)
14+
- Link URL over-escaping. Dedicated `escape_url()` method only escapes `)` and `\` per Telegram MarkdownV2 spec, fixing broken URLs like `https://example\.com`
15+
16+
### Added
17+
- `TelegramRenderer` state machine for context-aware escaping: 19 special characters in text, only `\` and `` ` `` in code blocks
18+
- Markdown formatting support: bold, italic, strikethrough, headers, code blocks, links, lists, blockquotes
19+
- Comprehensive benchmark suite with criterion: 7 scenario groups measuring latency (2.83µs for 500 chars) and throughput (121-970 MiB/s)
20+
- Memory profiling test to measure escaping overhead (3-20% depending on content)
21+
- 30 markdown unit tests covering formatting, escaping, edge cases, and UTF-8 chunking (99.32% line coverage)
22+
23+
### Changed
24+
- `crates/zeph-channels/src/markdown.rs`: Complete rewrite with pulldown-cmark event-driven parser (449 lines)
25+
- `crates/zeph-channels/src/telegram.rs`: Removed `has_unclosed_code_block()` pre-flight check (no longer needed with AST parsing), integrated UTF-8 safe chunking
26+
- Dependencies: Added pulldown-cmark 0.13.0 (MIT) and criterion 0.8.0 (Apache-2.0/MIT) for benchmarking
27+
928
## [0.4.1] - 2026-02-08
1029

1130
### Fixed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "3"
55
[workspace.package]
66
edition = "2024"
77
rust-version = "1.88"
8-
version = "0.4.1"
8+
version = "0.4.2"
99
authors = ["bug-ops"]
1010
license = "MIT"
1111
repository = "https://github.com/bug-ops/zeph"
@@ -33,12 +33,12 @@ toml = "0.9"
3333
tracing = "0.1"
3434
tracing-subscriber = "0.3"
3535
uuid = "1.20"
36-
zeph-channels = { path = "crates/zeph-channels", version = "0.4.1" }
37-
zeph-core = { path = "crates/zeph-core", version = "0.4.1" }
38-
zeph-llm = { path = "crates/zeph-llm", version = "0.4.1" }
39-
zeph-memory = { path = "crates/zeph-memory", version = "0.4.1" }
40-
zeph-skills = { path = "crates/zeph-skills", version = "0.4.1" }
41-
zeph-tools = { path = "crates/zeph-tools", version = "0.4.1" }
36+
zeph-channels = { path = "crates/zeph-channels", version = "0.4.2" }
37+
zeph-core = { path = "crates/zeph-core", version = "0.4.2" }
38+
zeph-llm = { path = "crates/zeph-llm", version = "0.4.2" }
39+
zeph-memory = { path = "crates/zeph-memory", version = "0.4.2" }
40+
zeph-skills = { path = "crates/zeph-skills", version = "0.4.2" }
41+
zeph-tools = { path = "crates/zeph-tools", version = "0.4.2" }
4242

4343
[workspace.lints.clippy]
4444
all = "warn"

README.md

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[![CI](https://img.shields.io/github/actions/workflow/status/bug-ops/zeph/ci.yml?branch=main)](https://github.com/bug-ops/zeph/actions)
44
[![codecov](https://codecov.io/gh/bug-ops/zeph/graph/badge.svg?token=S5O0GR9U6G)](https://codecov.io/gh/bug-ops/zeph)
55
[![Security](https://img.shields.io/badge/security-hardened-brightgreen)](SECURITY.md)
6+
[![Trivy Scan](https://img.shields.io/badge/Trivy-0%20CVEs-success)](https://github.com/bug-ops/zeph/security)
67
![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue)
8+
[![MSRV](https://img.shields.io/badge/MSRV-1.88-blue)](https://www.rust-lang.org)
79
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
810

911
Lightweight AI agent with hybrid inference (Ollama / Claude), skills-first architecture, semantic memory with Qdrant, and multi-channel I/O. **Cross-platform**: Linux, macOS, Windows (x86_64 + ARM64).
@@ -44,10 +46,10 @@ docker pull ghcr.io/bug-ops/zeph:latest
4446
Or use a specific version:
4547

4648
```bash
47-
docker pull ghcr.io/bug-ops/zeph:v0.4.1
49+
docker pull ghcr.io/bug-ops/zeph:v0.4.2
4850
```
4951

50-
**Security:** Images are scanned with [Trivy](https://trivy.dev/) and use Oracle Linux 9 Slim base with **0 HIGH/CRITICAL CVEs**. Multi-platform: linux/amd64, linux/arm64.
52+
**Security:** Images are scanned with [Trivy](https://trivy.dev/) in CI/CD and use Oracle Linux 9 Slim base with **0 HIGH/CRITICAL CVEs**. Multi-platform: linux/amd64, linux/arm64.
5153

5254
## Usage
5355

@@ -291,7 +293,7 @@ docker compose --profile gpu -f docker-compose.yml -f docker-compose.gpu.yml up
291293

292294
```bash
293295
# Use a specific release version
294-
ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.4.1 docker compose up
296+
ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.4.2 docker compose up
295297

296298
# Always pull latest
297299
docker compose pull && docker compose up
@@ -308,46 +310,80 @@ ZEPH_IMAGE=zeph:local docker compose up --build
308310

309311
## Security
310312

311-
Zeph implements multiple security layers to ensure safe operation in production environments.
313+
Zeph implements defense-in-depth security for safe AI agent operations in production environments.
312314

313315
### Shell Command Filtering
314316

315317
> [!WARNING]
316-
> Shell commands from LLM responses are filtered through a security layer before execution.
318+
> All shell commands from LLM responses pass through a security filter before execution. Commands matching blocked patterns are rejected with detailed error messages.
317319
318320
**12 blocked patterns by default:**
319-
- `rm -rf /` — filesystem destruction
320-
- `sudo` — privilege escalation
321-
- `mkfs` — filesystem formatting
322-
- `dd if=` — low-level disk operations
323-
- `curl`, `wget` — arbitrary code download
324-
- `nc`, `ncat`, `netcat` — reverse shells
325-
- `shutdown`, `reboot`, `halt` — system control
326321

327-
**Custom patterns:** Add project-specific blocked commands via `tools.shell.blocked_commands` in config. Custom patterns are additive to defaults (cannot weaken security).
322+
| Pattern | Risk Category | Examples |
323+
|---------|---------------|----------|
324+
| `rm -rf /`, `rm -rf /*` | Filesystem destruction | Prevents accidental system wipe |
325+
| `sudo`, `su` | Privilege escalation | Blocks unauthorized root access |
326+
| `mkfs`, `fdisk` | Filesystem operations | Prevents disk formatting |
327+
| `dd if=`, `dd of=` | Low-level disk I/O | Blocks dangerous write operations |
328+
| `curl \| bash`, `wget \| sh` | Arbitrary code execution | Prevents remote code injection |
329+
| `nc`, `ncat`, `netcat` | Network backdoors | Blocks reverse shell attempts |
330+
| `shutdown`, `reboot`, `halt` | System control | Prevents service disruption |
331+
332+
**Configuration:**
333+
```toml
334+
[tools.shell]
335+
timeout = 30 # Command execution timeout
336+
blocked_commands = ["custom_pattern"] # Additional patterns (additive to defaults)
337+
```
328338

329-
**Case-insensitive matching:** `SUDO`, `Sudo`, `sudo` all blocked.
339+
> [!IMPORTANT]
340+
> Custom patterns are **additive** — you cannot weaken default security. Matching is case-insensitive (`SUDO`, `Sudo`, `sudo` all blocked).
341+
342+
**Safe execution model:**
343+
- Commands parsed for blocked patterns before execution
344+
- Timeout enforcement (default: 30s, configurable)
345+
- Sandboxed execution with restricted environment
346+
- Full errors logged to system, sanitized messages shown to users
330347

331348
### Container Security
332349

333-
Docker images are hardened for production use:
350+
Docker images follow security best practices:
351+
352+
| Security Layer | Implementation | Status |
353+
|----------------|----------------|--------|
354+
| **Base image** | Oracle Linux 9 Slim | Production-hardened |
355+
| **Vulnerability scanning** | Trivy in CI/CD | **0 HIGH/CRITICAL CVEs** |
356+
| **User privileges** | Non-root `zeph` user (UID 1000) | ✅ Enforced |
357+
| **Attack surface** | Minimal package installation | Distroless-style |
358+
| **Image signing** | Coming soon (issue #TBD) | 🚧 Planned |
334359

335-
- **Base image:** Oracle Linux 9 Slim (security-first distribution)
336-
- **Vulnerability scanning:** Every release scanned with [Trivy](https://trivy.dev/)
337-
- **Zero vulnerabilities:** **0 HIGH/CRITICAL CVEs** in latest release
338-
- **Non-root user:** Runs as dedicated `zeph` user (UID 1000)
339-
- **Minimal attack surface:** Only required packages installed
360+
**Continuous security:**
361+
- Every release scanned with [Trivy](https://trivy.dev/) before publishing
362+
- Automated Dependabot PRs for dependency updates
363+
- `cargo-deny` checks in CI for license/vulnerability compliance
340364

341-
### Secure by Default
365+
### Code Security
342366

343-
- **Timeout protection:** Shell commands limited to 30s (configurable)
344-
- **Error sanitization:** Full errors logged, generic messages shown to users
345-
- **No `unsafe` code:** Project policy denies unsafe Rust blocks
346-
- **Secrets management:** API keys via environment variables (vault integration planned, see [#70](https://github.com/bug-ops/zeph/issues/70))
367+
Rust-native memory safety guarantees:
368+
369+
- **Zero `unsafe` blocks:** Project policy enforces `#![forbid(unsafe_code)]`
370+
- **No panic in production:** `unwrap()` and `expect()` linted via clippy
371+
- **Secure dependencies:** All crates audited with `cargo-deny`
372+
- **MSRV policy:** Rust 1.88+ (Edition 2024) for latest security patches
373+
374+
### Secrets Management
375+
376+
> [!CAUTION]
377+
> API keys and tokens must be passed via environment variables. Never commit secrets to version control.
378+
379+
**Current:** Environment variables (`ZEPH_CLAUDE_API_KEY`, `ZEPH_TELEGRAM_TOKEN`)
380+
**Planned:** Vault integration for centralized secret rotation (see [#70](https://github.com/bug-ops/zeph/issues/70))
347381

348382
### Reporting Security Issues
349383

350-
See [SECURITY.md](SECURITY.md) for vulnerability disclosure process.
384+
Found a vulnerability? See [SECURITY.md](SECURITY.md) for responsible disclosure process.
385+
386+
**Security contact:** Submit via GitHub Security Advisories (confidential)
351387

352388
## Architecture
353389

0 commit comments

Comments
 (0)