Agents/Security: block tainted sink calls from untrusted tool outputs#13293
Closed
soumikbhatta wants to merge 1 commit into
Closed
Agents/Security: block tainted sink calls from untrusted tool outputs#13293soumikbhatta wants to merge 1 commit into
soumikbhatta wants to merge 1 commit into
Conversation
Contributor
Author
|
Closing — this PR is too large for effective review (638 LOC). Will split into smaller, focused PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a lightweight provenance tracker that records snippets from untrusted external tool outputs and blocks sensitive sink tool calls when those snippets are reused in tool parameters.
This packages the taint/provenance mitigation work for openclaw/trust#2.
lobster-biscuit
Repro Steps
web_fetch) that includes shell/file payload text.exec) with parameters that include that payload.Root Cause
The runtime did not carry forward any structured trust/provenance signal from tool results into later tool-call decisions. The
before_tool_callpath had no built-in taint check, and tool-result persistence had no provenance capture.Behavior Changes
ProvenanceTracker(src/agents/provenance.ts) with per-session taint capture and sink checks.before_tool_callpath now enforces taint blocking for sensitive sinks (exec, write/edit/message family, plus legacy aliases).guardSessionManagernow records tainted snippets from external tool result text before persistence-hook transforms.2026.2.9fixes referencingopenclaw/trust#2.Codebase and GitHub Search
Tests
pnpm lint✅pnpm check✅pnpm build✅pnpm test✅src/agents/provenance.test.tssrc/agents/pi-tools.before-tool-call.test.ts(taint block case)src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts(taint capture case)Manual Testing (omit if N/A)
Prerequisites
Steps
execwith params containing that text.Evidence (omit if N/A)
pnpm lintpnpm checkpnpm buildpnpm testSign-Off
Greptile Overview
Greptile Summary
I wasn’t able to review PR #13293 yet because the actual patch/diff content isn’t available in this environment (the repo working tree is clean at
a4c00ab, and I can’t fetch the PR diff from GitHub without a provided diff or a local PR ref). If you paste thegit diff 53fd26a...a4c00ab...output for the 7 changed files (or provide a local branch/checkout containing the PR changes), I can do a line-level review and leave concrete merge-blocking comments.Given the description, the change introduces a
ProvenanceTrackerand blocks sensitive sink tools when tainted snippets are detected in tool-call parameters, plus captures taint from external tool results before persistence-hook transforms. Once I can see the code, I’ll verify:No actionable findings can be confirmed without the diff content.
Confidence Score: 1/5
(5/5) You can turn off certain types of comments like style here!
Context used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)