Commit graph

241 commits

Author SHA1 Message Date
Will Sarg
aa014ab85b
Devsecops (#481)
* fix(workflows): standardize runner configuration for security jobs

* ci(actionlint): add Blacksmith runner label to config

Add blacksmith-2vcpu-ubuntu-2404 to actionlint self-hosted-runner labels config
to suppress "unknown label" warnings during workflow linting.

This label is used across all workflows after the Blacksmith migration.

* Merge branch 'main' into devsecops

* fix(actionlint): adjust indentation for self-hosted runner labels

* Merge branch 'main' into devsecops

* feat(security): enhance security workflow with CodeQL analysis steps

* Merge branch 'main' into devsecops

* fix(security): update CodeQL action to version 4 for improved analysis

* Merge branch 'main' into devsecops

* fix(security): remove duplicate permissions in security workflow

* fix(security): revert CodeQL action to v3 for stability

The v4 version was causing workflow file validation failures.
Reverting to proven v3 version that is working on main branch.

* fix(security): remove duplicate permissions causing workflow validation failure

The permissions block had duplicate security-events and actions keys,
which caused YAML validation errors and prevented workflow execution.

Fixes: workflow file validation failures on main branch

* Merge remote-tracking branch 'origin/main' into devsecops

* fix(security): remove pull_request trigger to reduce costs

* fix(security): restore PR trigger but skip codeql on PRs

* fix(security): resolve YAML syntax error in security workflow

* refactor(security): split CodeQL into dedicated scheduled workflow

* fix(security): update workflow name to Rust Package Security Audit

* fix(codeql): remove push trigger, keep schedule and on-demand only

* feat(codeql): add CodeQL configuration file to ignore specific paths

* Merge branch 'main' into devsecops

* Merge branch 'main' into devsecops

* Potential fix for code scanning alert no. 39: Hard-coded cryptographic value

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-17 00:16:23 -05:00
Argenis
e3ca2315d3
fix(nvidia): use correct NVIDIA_API_KEY environment variable
- Fixes the environment variable name from `NVIDIA_NIM_API_KEY` to `NVIDIA_API_KEY` to match NVIDIA's official documentation
- Adds model suggestions for NVIDIA NIM provider in the onboarding wizard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:23:02 -05:00
Lawyered
8cf6c89ebc docs(security): document single-ampersand blocking in command policy 2026-02-16 23:06:27 -05:00
Lawyered
e8088f624e test(security): cover background-chain validation path 2026-02-16 23:06:27 -05:00
Lawyered
0f56211892 fix(security): block single-ampersand command chaining bypass 2026-02-16 23:06:27 -05:00
Anton Dieterle
4d4c1e4965 Fix OpenCode API URL in provider configuration
Hey not sure why it was changed, but this is the correct URL for opencode zen
2026-02-16 23:01:53 -05:00
Argenis
b2facc7526
fix(cli): respect config default_temperature
Fixes #452 - CLI now respects config.default_temperature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 20:08:00 -05:00
Argenis
e8553a800a
fix(channels): use platform message IDs to prevent duplicate memories
Fixes #430 - Prevents duplicate memories after restart by using platform message IDs instead of random UUIDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 19:04:37 -05:00
Argenis
15e1d50a5d
fix: replace std::sync::Mutex with parking_lot::Mutex (#350)
Merges #422
2026-02-16 15:02:46 -05:00
Argenis
bff0507132
fix: prevent prompt injection via JSON extraction (#355)
Merges #416
2026-02-16 14:17:24 -05:00
Argenis
dc5a85c85c
fix: use 256-bit entropy for pairing tokens (#351)
Merges #413
2026-02-16 13:48:03 -05:00
Chummy
4264c3bb21
Merge pull request #397 from elonfeng/feat/dingtalk-channel
feat(channels): add DingTalk channel via Stream Mode
2026-02-17 01:11:12 +08:00
Chummy
9fbd8c7f57
Merge pull request #382 from fettpl/fix/356-gateway-error-leaks
fix(security): stop leaking serde parse details in gateway error responses
2026-02-17 01:10:27 +08:00
Chummy
2f57499a39
Merge pull request #379 from fettpl/fix/354-file-read-rate-limit
fix(security): move record_action before canonicalize in file_read
2026-02-17 01:10:16 +08:00
Chummy
f13ce909c4
Merge pull request #274 from mai1015/feat/refactor-agent-loop
feat(providers): add native tool-calling for OpenRouter/Anthropic and align provider tests with simple_chat
2026-02-17 01:06:56 +08:00
Chummy
88de2555ab
Merge pull request #391 from fettpl/fix/361-browser-security
security(browser): harden SSRF blocking and block file:// URLs
2026-02-17 01:06:50 +08:00
Chummy
e005b6d9e4 fix(rebase): unify agent config and remove duplicate fields 2026-02-17 01:01:57 +08:00
Chummy
413ecfd143 fix(rebase): resolve main drift and restore CI contracts 2026-02-17 01:01:57 +08:00
Chummy
b2dd3582a4 fix(ci): align reliable tests with simple_chat contract 2026-02-17 01:01:56 +08:00
mai1015
dc5e14d7d2 refactor: improve code formatting and structure across multiple files 2026-02-17 01:01:56 +08:00
mai1015
b341fdb368 feat: add agent structure and improve tooling for provider 2026-02-17 01:01:56 +08:00
Chummy
e2c966d31e
Merge pull request #389 from reidliu41/add-qwen
feat(provider): add Qwen/DashScope provider with multi-region support
2026-02-17 00:58:04 +08:00
Chummy
e6d79283d1
Merge pull request #378 from fettpl/fix/353-rate-limiter-memory
fix(gateway): add periodic sweep to SlidingWindowRateLimiter
2026-02-17 00:57:38 +08:00
elonf
9463bf08a4 feat(channels): add DingTalk channel via Stream Mode
Implement DingTalk messaging channel using the official Stream Mode
WebSocket protocol with per-message session webhook replies.

- Add DingTalkChannel with send/listen/health_check support
- Add DingTalkConfig (client_id, client_secret, allowed_users)
- Integrate with onboard wizard, integrations registry, and channel
  list/doctor commands
- Include unit tests for user allowlist rules and config serialization
2026-02-17 00:53:13 +08:00
fettpl
882defef12 security(browser): harden SSRF blocking and block file:// URLs
- Block file:// URLs which bypassed all SSRF and domain-allowlist
  controls, enabling arbitrary local file exfiltration via browser
- Harden is_private_host() to match http_request.rs coverage:
  multicast, broadcast, reserved (240/4), shared address space
  (100.64/10), documentation IPs, benchmarking IPs
- Add .localhost subdomain and .local mDNS TLD blocking
- Extract is_non_global_v4() and is_non_global_v6() helpers

Closes #361

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:49:21 +01:00
Chummy
c11c569ddd
Merge pull request #377 from fettpl/fix/352-ssrf-ip-blocking
fix(security): block multicast/broadcast/reserved IPs in SSRF protection
2026-02-17 00:47:46 +08:00
reidliu41
6bb9bc47c0 feat(provider): add Qwen/DashScope provider with multi-region support
- Add Alibaba Qwen as an OpenAI-compatible provider via DashScope API
- Support three regional endpoints: China (Beijing), Singapore, and US (Virginia)
- All regions share a single `DASHSCOPE_API_KEY` environment variable

| Config Value | Region | Base URL |
|---|---|---|
| `qwen` / `dashscope` | China (Beijing) | `dashscope.aliyuncs.com/compatible-mode/v1` |
| `qwen-intl` / `dashscope-intl` | Singapore | `dashscope-intl.aliyuncs.com/compatible-mode/v1` |
| `qwen-us` / `dashscope-us` | US (Virginia) | `dashscope-us.aliyuncs.com/compatible-mode/v1` |
2026-02-17 00:42:53 +08:00
Chummy
02decd309f fix(security): tighten SSRF IP classification for docs ranges 2026-02-17 00:41:48 +08:00
ehu shubham shaw
de3ec87d16
Ehu shubham shaw contribution --> Hardware support (#306)
* feat: add ZeroClaw firmware for ESP32 and Nucleo

* Introduced new firmware for ZeroClaw on ESP32 and Nucleo-F401RE, enabling JSON-over-serial communication for GPIO control.
* Added `zeroclaw-esp32` with support for commands like `gpio_read` and `gpio_write`, along with capabilities reporting.
* Implemented `zeroclaw-nucleo` firmware with similar functionality for STM32, ensuring compatibility with existing ZeroClaw protocols.
* Updated `.gitignore` to include new firmware targets and added necessary dependencies in `Cargo.toml` for both platforms.
* Created README files for both firmware projects detailing setup, build, and usage instructions.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* feat: enhance hardware peripheral support and documentation

- Added `Peripheral` trait implementation in `src/peripherals/` to manage hardware boards (STM32, RPi GPIO).
- Updated `AGENTS.md` to include new extension points for peripherals and their configuration.
- Introduced comprehensive documentation for adding boards and tools, including a quick start guide and supported boards.
- Enhanced `Cargo.toml` to include optional dependencies for PDF extraction and peripheral support.
- Created new datasheets for Arduino Uno, ESP32, and Nucleo-F401RE, detailing pin aliases and GPIO usage.
- Implemented new tools for hardware memory reading and board information retrieval in the agent loop.

This update significantly improves the integration and usability of hardware peripherals within the ZeroClaw framework.

* feat: add ZeroClaw firmware for ESP32 and Nucleo

* Introduced new firmware for ZeroClaw on ESP32 and Nucleo-F401RE, enabling JSON-over-serial communication for GPIO control.
* Added `zeroclaw-esp32` with support for commands like `gpio_read` and `gpio_write`, along with capabilities reporting.
* Implemented `zeroclaw-nucleo` firmware with similar functionality for STM32, ensuring compatibility with existing ZeroClaw protocols.
* Updated `.gitignore` to include new firmware targets and added necessary dependencies in `Cargo.toml` for both platforms.
* Created README files for both firmware projects detailing setup, build, and usage instructions.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* feat: enhance hardware peripheral support and documentation

- Added `Peripheral` trait implementation in `src/peripherals/` to manage hardware boards (STM32, RPi GPIO).
- Updated `AGENTS.md` to include new extension points for peripherals and their configuration.
- Introduced comprehensive documentation for adding boards and tools, including a quick start guide and supported boards.
- Enhanced `Cargo.toml` to include optional dependencies for PDF extraction and peripheral support.
- Created new datasheets for Arduino Uno, ESP32, and Nucleo-F401RE, detailing pin aliases and GPIO usage.
- Implemented new tools for hardware memory reading and board information retrieval in the agent loop.

This update significantly improves the integration and usability of hardware peripherals within the ZeroClaw framework.

* feat: Introduce hardware auto-discovery and expanded configuration options for agents, hardware, and security.

* chore: update dependencies and improve probe-rs integration

- Updated `Cargo.lock` to remove specific version constraints for several dependencies, including `zerocopy`, `syn`, and `strsim`, allowing for more flexibility in version resolution.
- Upgraded `bincode` and `bitfield` to their latest versions, enhancing serialization and memory management capabilities.
- Updated `Cargo.toml` to reflect the new version of `probe-rs` from `0.24` to `0.30`, improving hardware probing functionality.
- Refactored code in `src/hardware` and `src/tools` to utilize the new `SessionConfig` for session management in `probe-rs`, ensuring better compatibility and performance.
- Cleaned up documentation in `docs/datasheets/nucleo-f401re.md` by removing unnecessary lines.

* fix: apply cargo fmt

* docs: add hardware architecture diagram.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 11:40:10 -05:00
Chummy
b36f23784a
fix(build): harden rustls dependency path for Linux builds (#275) 2026-02-17 00:39:28 +08:00
fettpl
91ae151548 style: fix rustfmt formatting in SSRF tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:35:30 +01:00
Chummy
3234159c6c
chore(clippy): clear warning backlog and harden conversions (#383) 2026-02-17 00:32:33 +08:00
Chummy
a91516df7a
Merge pull request #368 from fettpl/fix/349-email-bounded-seen-set
fix(channels): bound email seen_messages set to prevent memory leak
2026-02-17 00:32:29 +08:00
Chummy
53844f7207
feat(memory): lucid memory integration with optional backends (#285) 2026-02-17 00:31:50 +08:00
Chummy
04bf94443f
feat(browser): add optional computer-use sidecar backend (#335) 2026-02-17 00:31:45 +08:00
fettpl
e6ad48df48 fix(security): stop leaking serde parse details in gateway error responses
Replace the dynamic error message in the webhook JSON parsing error
path with a static message. Previously, the raw JsonRejection error
from axum/serde was interpolated into the HTTP response, potentially
exposing internal parsing details to unauthenticated callers.

The detailed error is now logged server-side via tracing::warn for
debugging, while the client receives a generic "Invalid JSON body"
message.

Closes #356

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:27:07 +01:00
fettpl
c54bfe3814 fix(security): move record_action before canonicalize in file_read
Move the rate limit budget consumption (record_action) to immediately
after the path allowlist check but before canonicalization. Previously,
an attacker could probe whether arbitrary paths exist via canonicalize
errors without consuming any rate limit budget, since record_action
was only called after the file size check.

Now every request that passes the basic path validation consumes rate
limit budget, regardless of whether the file exists.

Closes #354

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:21:52 +01:00
fettpl
5af74d1d20 fix(gateway): add periodic sweep to SlidingWindowRateLimiter
Add a sweep mechanism that removes stale IP entries from the rate
limiter's HashMap every 5 minutes. Previously, IPs that made a single
request and never returned would accumulate indefinitely, causing
unbounded memory growth proportional to unique client IPs.

The sweep runs inline during allow() calls — no background task needed.
A last_sweep timestamp ensures the full-map scan only happens once per
sweep interval, keeping amortized overhead minimal.

Closes #353

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:20:12 +01:00
fettpl
7db71de043 fix(channels): bound email seen_messages set to prevent memory leak
Replace unbounded HashSet<String> with a BoundedSeenSet that evicts
the oldest message IDs (FIFO) when the 100k capacity is reached. This
prevents memory growth proportional to email volume over the process
lifetime, capping the set at ~100k entries regardless of runtime.

Closes #349

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 00:19:03 +08:00
fettpl
dd74e29f71 fix(security): block multicast/broadcast/reserved IPs in SSRF protection
Rewrite is_private_or_local_host() to use std::net::IpAddr for robust
IP classification instead of manual octet matching. Now blocks all
non-globally-routable address ranges:

- Multicast (224.0.0.0/4, ff00::/8)
- Broadcast (255.255.255.255)
- Reserved (240.0.0.0/4)
- Documentation (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24)
- Benchmarking (198.18.0.0/15)
- IPv6 unique-local (fc00::/7) and link-local (fe80::/10)
- IPv4-mapped IPv6 (::ffff:x.x.x.x) with recursive v4 checks

Closes #352

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:18:17 +01:00
Chummy
639032c952
Merge pull request #331 from stakeswky/feat/lark-channel
feat(channels): add Lark/Feishu IM channel support
2026-02-17 00:08:05 +08:00
fettpl
60e72a6ed5 fix(main): remove duplicate ModelCommands enum definition
A duplicate ModelCommands enum was introduced in a recent merge,
causing E0119/E0428 compile errors on CI (Rust 1.92).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 17:00:10 +01:00
fettpl
a871b28f85 fix(tools): use original headers for HTTP requests, redact only in display
sanitize_headers was replacing sensitive header values with
***REDACTED*** before passing them to the actual HTTP request,
breaking any authenticated API call. Split into parse_headers
(preserves original values for the request) and
redact_headers_for_display (returns redacted copy for output/logging).

Closes #348

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:59:05 +01:00
cd slash
5b19502bd9
fix(providers): correct Fireworks AI base URL to include /v1 path (#346)
The Fireworks API endpoint requires /v1/chat/completions, but the
base URL was missing the /v1 path segment, causing 404 errors and
triggering a broken responses fallback.

Fix: Add /v1 to base URL so correct endpoint is built:
  https://api.fireworks.ai/inference/v1/chat/completions
2026-02-16 23:53:34 +08:00
Chummy
e4944a5fc2
feat(cost): add budget tracking core and harden storage reliability (#292) 2026-02-16 23:40:47 +08:00
Chummy
8882746ced
fix(onboard): refresh MiniMax defaults and endpoint (#299) 2026-02-16 23:40:44 +08:00
Chummy
23b0f360c2
fix(composio): align v3 execute path and honor configured entity_id (#322) 2026-02-16 23:40:37 +08:00
Chummy
a403b5f5b1
feat(onboard): add provider model refresh command with TTL cache (#323) 2026-02-16 23:40:33 +08:00
Chummy
80da3e64e9
feat: unify scheduled tasks from #337 and #338 with security-first integration
Unifies scheduled task capabilities and consolidates overlapping implementations from #337 and #338 into a single security-first integration path.\n\nCo-authored-by: Edvard <ecschoye@stud.ntnu.no>\nCo-authored-by: stawky <stakeswky@gmail.com>
2026-02-16 23:38:29 +08:00
Chummy
826f3836c7 fix(test): adapt lark schema assertions to current config fields 2026-02-16 22:57:45 +08:00