Skip to content

[CTX-0216] feat(agent): credential scrubbing for tool args/results - #370

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-0216/feat-credential-scrubbing
Sep 7, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-0216/feat-credential-scrubbing

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

FIND-0002 follow-up. ToolSpec validated bounds only; tool arguments/results now scrub secrets before logs/IPC.

Scrubbing (crates/bitty-agent/src/tool.rs, std-only):

  • REDACTED_MARKER ([redacted], ipc parity), is_sensitive_key, looks_like_secret_token, scrub_text/scrub_tool_args/scrub_tool_result.
  • JSON quoted-key + bare key=value/key: value redaction; PEM/prefix/bearer unstructured pass; fail-closed whole-payload redact on ambiguous shapes.
  • ToolCall/ToolResult: redacting Debug, scrubbed/scrubbed_arguments/scrubbed_content/log_safe; raw kept only for host dispatch.
  • Exports wired in lib.rs.

Tests: 9 new cases (args/results/logs redaction, legit passthrough, case-insensitive/bare/bearer/PEM/prefix, ambiguous fail-safe incl. nested/numeric/unterminated, Debug/log_safe, caps, key heuristics). cargo test -p bitty-agent: 39 passed. cargo test -p bitty-runtime: green (sole consumer). Full workspace: only 2 flaky bitty-app pump tests fail in parallel run; both pass isolated with and without this diff (no dep path bitty-app->bitty-agent).

Priority: P2 | Area: agent | Labels: feat,area:agent,P2 | Milestone: v0.1.0 | RFC: FIND-0002 | Task: CTX-0216

Closes #369

@Xuepoo Xuepoo added feat Feature area:agent Area: agent core P2 Priority: medium labels Sep 7, 2026
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 7, 2026
@Xuepoo
Xuepoo force-pushed the ctx-0216/feat-credential-scrubbing branch from 01d3faf to 68b0dc4 Compare September 7, 2026 02:24
@Xuepoo
Xuepoo merged commit a2d127b into main Sep 7, 2026
10 checks passed
@Xuepoo
Xuepoo deleted the ctx-0216/feat-credential-scrubbing branch September 7, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Area: agent core feat Feature P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CTX-0216] Credential scrubbing for agent tool specs

1 participant