Repository navigation
Refuse non-string policy arguments and judge every result output in the reference Guardian - #499
Open
drk-ram wants to merge 1 commit into
Conversation
…he reference Guardian A tool argument the gates read (the policy target, url, endpoint, host, domain) that was not a string left the gate rule undefined, which AGT answers as an allow. The request assembler now refuses such a value, so the step ends in the evaluation_failed deny. The result gate judged only outputs[0].value; it now cuts the result into one single-output snapshot per string leaf, evaluates each, and returns the most restrictive decision with each redaction addressed to its own JSON pointer. A result with more than 256 strings, or nested deeper than 32 levels, is refused. Closes GenAI-Security-Project#469 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
drk-ram
requested review from
GangGreenTemperTatum,
afogel,
artmaro,
bar-capsule,
fewdisc,
mamicidal,
rocklambros and
sclintonowasp
as code owners
November 4, 2026 20:13
|
Thanks for this. It is queued rather than ignored. A lead has not reviewed this pull request yet. A lead will read it when they have time, and we can't promise a date. Nothing here is rejected. If a check below fails, please fix it. A pull request that waits a long time may be closed, and you can reopen it later. |
This branch has not been deployed
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.
What changed
The reference Guardian now refuses a tool argument it cannot judge as a string, and judges every output of a result instead of only
outputs[0].assemblePreToolCallSnapshotrefuses a policy-target value, or aurl,endpoint,hostordomainvalue, that is not a string (array, object, number, boolean, null). The step ends in the existingevaluation_faileddeny, the same path a missing target takes, instead of reaching AGT as an undefined rule and an allow.assemblePostToolCallUnits), evaluates each with the unchangedpost_tool_callpolicy, and returns the most restrictive decision (deny, ask, modify, allow). Each redaction is addressed to the JSON pointer of the leaf it came from, so["ok", "token=..."]and[{"stdout": "token=..."}]are redacted at/outputs/1/valueand/outputs/0/value/stdout.policy/is untouched, soverify:pinis unaffected.Which issue does this implement
Closes #469
meaning, so it needs no issue
Base branch
integration, because this touches the specification, schemas, a referenceimplementation, an adapter, tests, or CI
main, because every changed path is on the documentation lane allowlist inCONTRIBUTING.md
Type of change
I tested this
Run from
reference-implementations/agtwith Bun 1.4.4 on Windows x64 andACS_OPA_PATHpointing at the installed OPA binary.bba1b84, the currentintegrationhead)uv run pytest -vpasses on my machine (not run: no specification or Python file changed)uv run mkdocs build --strictpasses on my machine (not run: no docs page changed)Results:
bun test packages/guardian/test/non-string-values.test.ts packages/guardian/test/result-output-units.test.ts: 19 pass, 0 fail. Onorigin/integrationsource the samenon-string-values.test.tsis 11 fail, 5 pass.bun run typecheck: clean.bun test(whole tree): the same 89 to 90 failures as onorigin/integrationbefore this change, all Windows-environment cases (loopback proxy variables, file modes 0600/0700, repo-root path stripping, README banner lines). Nothing outside them changed.Checklist
git commit -s(required by the DCO)Security
This closes a fail-open: the same deployment denied
rm -rf /as a string and allowed it as["rm","-rf","/"], and left a secret in a second or structured output unredacted. The change moves both cases to deny or redact. Nothing here is an unreported vulnerability beyond what #469 already describes.