You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Engine: evaluate tool permissions on the same argument decode the tool executes #2264
The policy evaluator and the tool runtime read a tool call's JSON arguments with different rules:
Shell permission matching (governance.ShellCommandFromArgs, engine/governance/evaluator.go) reads the command from specific exact key names.
Shell execution (parseShellArgs, engine/agent/shelltool.go) decodes the same arguments with Go's encoding/json struct decoding, which has its own rules for key matching and repeated keys.
The command used to decide a call's permission should always be exactly the command that runs. Today, for some argument shapes, the two can differ.
Expected
For every tool whose permission depends on its arguments, permission evaluation and execution derive the value from one shared decode of the arguments, so they cannot disagree. Argument objects that don't decode to a single unambiguous value are rejected before policy evaluation, rather than interpreted differently by each side.
Scope
Shell first. Then check the other tools whose policy matching reads arguments (file paths for Edit/Write/Read, network targets, MCP tool arguments if matched) for the same split.
One decode path shared by policy evaluation, approval display and execution. Alternatively, reject ambiguous argument objects in session.ParseArgs before anything reads them.
Tests proving, for each affected tool, that the value the policy evaluates equals the value the tool executes, across argument encodings.
A changelog entry for any behaviour change for clients that relied on the old reading.
Related: #2263 (approval display of system temp-scope Shell calls).
Activity
test(engine): restore the escaped-key cases in the argument checks
fix(engine): evaluate tool permissions on the same argument decode th…
test(engine): restore the escaped-key cases in the argument checks
fix(engine): evaluate tool permissions on the same argument decode th…
test(engine): restore the escaped-key cases in the argument checks
fix(engine): evaluate tool permissions on the same argument decode th…
test(engine): restore the escaped-key cases in the argument checks