Skip to content

docs: http_request tool broken by three zero-value config defaults#12

Open
walterpembery wants to merge 30 commits intoopenagen:mainfrom
walterpembery:docs/docker-tool-visibility
Open

docs: http_request tool broken by three zero-value config defaults#12
walterpembery wants to merge 30 commits intoopenagen:mainfrom
walterpembery:docs/docker-tool-visibility

Conversation

@walterpembery
Copy link

@walterpembery walterpembery commented Feb 28, 2026

Summary

  • Problem: The http_request tool fails silently in multiple independent ways when config values are left at their default zero values
  • Why it matters: Each failure looks like a different error type, making diagnosis difficult. Users can spend significant time debugging what is ultimately three config values that need non-zero defaults
  • What changed: Added a ## Docker Deployment section to docs/troubleshooting.md documenting all three issues
  • What did not change: No code changes; docs-only

The Three Bugs

When enabling [http_request] in config.toml, three separate config values all default to zero, each independently breaking the tool in a different way:

1. Empty allowed_domains = []

Contrary to what you might expect, an empty allowlist does not mean "allow all" — it means http_request immediately errors with:

HTTP request tool is enabled but no allowed_domains are configured

Fix: Add domains explicitly, e.g.:

allowed_domains = [github.com, api.github.com, en.wikipedia.org]

2. timeout_secs = 0 → every request fails immediately

A zero timeout causes every outbound request to fail at the transport layer before any data is exchanged. Error looks like a network failure.

Fix:

timeout_secs = 30

3. max_response_size = 0 → all responses silently discarded

A zero max response size causes every response to be truncated to zero bytes. The request succeeds, but the tool returns an empty string. No error is surfaced.

Fix:

max_response_size = 524288  # 512KB, adjust to taste

Full working [http_request] config

[http_request]
enabled = true
allowed_domains = ["github.com", "api.github.com", "en.wikipedia.org"]
max_response_size = 524288
timeout_secs = 30

Label Snapshot (required)

  • Risk label: risk: low
  • Size label: size: XS
  • Scope labels: docs
  • Module labels: tool: http_request

Change Metadata

  • Change type: docs
  • Primary scope: docs

Linked Issue

  • Related: N/A (issues disabled on repo)

Validation Evidence (required)

All three bugs reproduced and verified on macOS (arm64), native launchd deployment, ZeroClaw 0.1.0:

  • Empty allowlist: confirmed error message
  • timeout_secs = 0: confirmed immediate transport failure
  • max_response_size = 0: confirmed empty response, tool returned empty string; setting to 524288 resolved

Security Impact (required)

  • New permissions/capabilities? No
  • New external network calls? No
  • Secrets/tokens handling changed? No
  • File system access scope changed? No

Privacy and Data Hygiene (required)

  • Data-hygiene status: pass

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No — docs only
  • Migration needed? No

Human Verification (required)

  • Verified: all three bugs reproduced individually and fixed; http_request confirmed working end-to-end after all three fixes applied
  • What was not verified: whether these defaults differ by platform or install method

Side Effects / Blast Radius (required)

  • Docs only

Rollback Plan (required)

  • Revert the docs change; no production config changes in this PR

Risks and Mitigations

  • Risk: Default values may differ by install method (Docker vs native vs bootstrap script) — the three zeros may not apply universally
    • Mitigation: PR body is descriptive rather than prescriptive; treat as a diagnosis guide

tgruben-circuit and others added 29 commits February 18, 2026 14:08
… MCU + Linux tools

Expand the existing UNO Q Bridge peripheral from 2 GPIO tools to 13 tools
covering the board's full capability set. ZeroClaw can now run as an
edge-native agent directly on the UNO Q's Debian Linux (Cortex-A53).

MCU tools (via Bridge socket to STM32U585):
- GPIO read/write (D0-D21), ADC read (A0-A5, 12-bit, 3.3V)
- PWM write (D3/D5/D6/D9/D10/D11), I2C scan/transfer, SPI transfer
- CAN send (stub), LED matrix (8x13), RGB LED (LED3-4)

Linux tools (direct MPU access):
- Camera capture (MIPI-CSI via GStreamer)
- Linux RGB LED (sysfs), System info (temp/mem/disk/wifi)

Also includes:
- Expanded Arduino sketch with all MCU peripheral handlers
- Expanded Python Bridge server with command routing
- DeployUnoQ CLI command for edge-native deployment via SSH
- Cross-compile script (dev/cross-uno-q.sh) for aarch64
- UNO Q datasheet for RAG pipeline (docs/datasheets/arduino-uno-q.md)
- Pin validation with datasheet constraints (PWM pins, ADC channels, etc.)
- 19 unit tests covering validation, response parsing, and tool schemas
Three issues discovered during deployment to actual UNO Q hardware:

1. Bridge.call() takes positional args, not a list — changed from
   Bridge.call("digitalRead", [pin]) to Bridge.call("digitalRead", pin)
2. Bridge.call() must run on main thread (not thread-safe) — restructured
   socket server to use a queue pattern: accept thread enqueues requests,
   main App.run() loop drains queue and calls Bridge
3. Docker container networking requires 0.0.0.0 bind (not 127.0.0.1)
4. Wire/SPI are built into Zephyr platform, removed from sketch.yaml
5. Renamed C++ functions to bridge_* prefix to avoid Arduino built-in clashes
6. Changed const char* params to String for MsgPack RPC compatibility

Tested on hannah.local: gpio_read, gpio_write, adc_read, pwm_write,
capabilities all confirmed working.
…l cross-compile config

- Camera capture tool now uses v4l2-ctl instead of GStreamer (works with
  USB cameras like NETUM, not just MIPI-CSI)
- Tool output includes [IMAGE:<path>] hint so Telegram channel sends
  the captured photo directly to the user
- Added width/height/device parameters (defaults: 1280x720, /dev/video0)
- Added aarch64-unknown-linux-musl linker config to .cargo/config.toml
…camera for USB

The daemon's channel server was missing peripheral tools — only the
interactive `agent` command loaded them. Now `start_channels()` calls
`create_peripheral_tools()` so Telegram/Discord/Slack channels get
access to all UNO Q hardware tools.

Also updated camera capture tool description to guide the LLM to use
[IMAGE:<path>] markers for Telegram photo delivery.
…tive

feat(peripherals): Arduino UNO Q edge-native agent with full MCU + Linux peripheral tools
Minor Cargo.lock update from running cargo commands during security
analysis — normalizes `rustix 1.1.3` version reference to `rustix`.

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
…260221

Fix default-feature build regressions on main
…tation

Fix 5 compilation errors blocking the build:
- reliable.rs: remove duplicate `chat` method implementation
- agent.rs, loop_.rs: replace `futures::` with `futures_util::` (correct crate name)
- Cargo.toml: add `alloc` feature to futures-util (required for join_all)
- memory/cli.rs: gate PostgresMemory behind #[cfg(feature = "memory-postgres")]
  with a clear compile-time error when the feature is absent

Security hardening:
- Enable Landlock sandbox by default on Linux: remove `optional = true` from
  the Linux-specific landlock dependency; replace all `cfg(feature = "sandbox-landlock")`
  gates with `cfg(target_os = "linux")` in mod.rs, detect.rs, and landlock.rs.
  The `sandbox-landlock` feature flag is kept as a no-op for backward compatibility.
- Add explicit security warning to channels-reference.md for the whatsapp-web
  feature flag (unofficial API, account-suspension risk, unpredictable attack surface).
- Add SSRF threat model document for the http_request tool:
  docs/security/http-request-ssrf-threat-model.md covering existing defenses
  (allowlist, private-host blocking, redirect-none, scheme restriction),
  known residual risks (DNS rebinding, HTTP cleartext), and operator guidance.
- Register the SSRF doc in docs/security/README.md.

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
Document the security model of the shell tool:
- Defenses in place: autonomy policy, command validation, rate limiting,
  env_clear + SAFE_ENV_VARS whitelist, 60s timeout, 1MB output truncation
- Residual risks: no FS isolation without Landlock, no network egress filter,
  parent fd inheritance, shell injection via interpolated command strings
- Full test coverage matrix
- Operator configuration guidance

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
Add a dated security audit table covering 8 tool surfaces identified
during the 2026-02-22 security analysis. Each entry includes the risk
area, current grade, finding, and a concrete recommended remediation.

Surfaces covered: http_request (MITM, DNS rebinding), file_write
(path traversal), shell (network egress), git_operations (unintended
push), browser/browser_open (SSRF-adjacent, phishing), delegate
(prompt injection), and compiler hygiene (allow suppression).

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
…urfaces

Full source-code re-audit of every tool in src/tools/. Previous table
covered 8 surfaces with preliminary grades. Updated table:

- Covers all 31 tool surfaces organized by tier (file, network,
  command execution, memory, delegation, scheduling, external APIs,
  utility, hardware, compiler hygiene)
- Corrects grades based on actual code inspection (e.g. file_read
  upgraded to A, git_operations to A-, http_request SSRF to B+)
- Adds new surfaces: file_read, glob_search, pdf_read, image_info,
  web_search_tool, browser_open, memory_*, cron_*, composio, pushover,
  proxy_config, screenshot, hardware_*, delegate
- Each entry includes a verified finding and a concrete recommended action
- Adds an overall posture summary table by tier

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
The `build_system_prompt_with_mode` function signature was extended with
a new `skills_prompt_mode: SkillsPromptInjectionMode` parameter, but the
call in the `native_tools_system_prompt_contains_zero_xml` test was not
updated to match. This caused a compile-time error (E0061: wrong number
of arguments) that blocked all test compilation.

Fix: pass `SkillsPromptInjectionMode::Full` as the 8th argument,
consistent with the default used throughout the codebase.

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
Fix 36 clippy errors and formatting violations to make the codebase
pass `cargo fmt --all -- --check` and `cargo clippy --all-targets -- -D warnings`
with zero diagnostics.

Key fixes by category:

Correctness:
- Replace invalid regex backreferences (\1) in XML tool-tag parser with a
  manual closing-tag search (iter_xml_tagged_sections); the `regex` crate
  does not support backreferences, so the original code would have panicked
  at runtime on first use of the XML dispatcher path.

MSRV:
- Bump rust-version 1.87 → 1.91 to align with str::floor_char_boundary
  (stable since 1.91) already used in shell/screenshot/memory tools.

Visibility / privacy:
- Narrow channels::handle_command to pub(crate) to match ChannelCommands
  visibility; eliminates private-interface-in-public-API lint.

Lint suppressions (intentional API surface):
- #[allow(unused_imports)] on pub use re-exports in cost/mod.rs,
  onboard/mod.rs, tools/mod.rs, peripherals/mod.rs that are used from the
  binary crate or are intentional public API.
- #[allow(clippy::unused_async)] on the hardware-feature stub for
  create_peripheral_tools (must stay async for call-site consistency).
- #[allow(clippy::assertions_on_constants)] on a platform-guard assertion
  in the landlock test.
- #[allow(clippy::type_complexity)] on the pairing guard's brute-force
  field.

Style / idiomatic fixes:
- Replace format!-collect with fold+writeln! in discord/telegram tests.
- Elide explicit lifetimes in providers/copilot.rs.
- Merge identical match arms (bedrock, compatible, telegram, wizard,
  main.rs unreachable arms).
- Use ? operator instead of let-else for question_mark lint.
- Use array-of-char pattern for manual_pattern_char_comparison.
- Remove needless return / continue statements.
- Derive Default for SkillsConfig (all fields use standard defaults).
- Replace criterion::black_box (deprecated) with std::hint::black_box.
- Box::pin large heartbeat future directly to move it off the stack.
- Use struct initializer syntax in config_persistence tests.
- Use array literals instead of vec! where Vec is not needed.
- Remove duplicate unreachable cfg block in memory/cli.rs.
- Fix unreadable long literal in nextcloud_talk test.
- Replace ALLOWED_IMAGE_MIME_TYPES.iter().any() with .contains().
- Suppress cast_possible_truncation for intentional u64→usize casts.

https://claude.ai/code/session_01EFyqry32yYwkmYs2zFMiyb
…onality-analysis-al5ZG

Claude/security functionality analysis al5 zg
Adds README.pt-br.md with full translation.
docs(i18n): add README Brazilian Portuguese translation
Adds Brazilian Portuguese (README.pt-br.md) to the languages section in README.md.

The translation file was previously merged.
docs(readme): add Portuguese (Brazil) language link
@github-actions
Copy link

Thanks for contributing to ZeroClaw.

For faster review, please ensure:

  • PR template sections are fully completed
  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings, and cargo test are included
  • If automation/agents were used heavily, add brief workflow notes
  • Scope is focused (prefer one concern per PR)

See CONTRIBUTING.md and docs/pr-workflow.md for full collaboration rules.

@github-actions
Copy link

github-actions bot commented Feb 28, 2026

PR intake checks found warnings (non-blocking)

Fast safe checks found advisory issues. CI lint/test/build gates still enforce merge quality.

  • Incomplete required PR template fields: validation commands, security risk/mitigation, privacy status, rollback plan

Action items:

  1. Complete required PR template sections/fields.
  2. Remove tabs, trailing whitespace, and merge conflict markers from added lines.
  3. Re-run local checks before pushing:
    • ./scripts/ci/rust_quality_gate.sh
    • ./scripts/ci/rust_strict_delta_gate.sh
    • ./scripts/ci/docs_quality_gate.sh

Run logs: https://github.com/openagen/zeroclaw/actions/runs/22529266994

Detected blocking line issues (sample):

  • none

Detected advisory line issues (sample):

  • none

@github-actions github-actions bot added docs Auto scope: docs/markdown/template files changed. size: XS Auto size: <=80 non-doc changed lines. risk: low Auto risk: docs/chore-only paths. labels Feb 28, 2026
@walterpembery walterpembery changed the title docs: note on Docker tool visibility and auth setup docs: http_request tool broken by three zero-value config defaults Feb 28, 2026
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Hi @walterpembery, friendly automation nudge from PR hygiene.

This PR has had no new commits for 180h and still needs an update before merge:

  • No CI Required Gate run was found for the current head commit.

Recommended next steps

  1. Rebase your branch on main.
  2. Push the updated branch and re-run checks (or use Re-run failed jobs).
  3. Post fresh validation output in this PR thread.

Maintainers: apply no-stale to opt out for accepted-but-blocked work.
Head SHA: 6a321f1044d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Auto scope: docs/markdown/template files changed. risk: low Auto risk: docs/chore-only paths. size: XS Auto size: <=80 non-doc changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants