Writing tool-call policy that checks argument values, not just tool names
Tool-call policy argument validation means evaluating the concrete values passed to a tool, such as the table, file path, recipient, amount or request scope, before the call executes. A tool name allowlist says which capability an agent may use. Argument-level policy says what that capability may touch. Write rules as allowlists, patterns, ranges, schema constraints and context conditions, attach an action to each rule, and enforce them in the execution path so every decision leaves evidence.
Evaluating the enforcement layer and its evidence
- Does it evaluate argument values before execution, in the path of the call?
- Can rules use allowlists, patterns, ranges, schema constraints and context conditions?
- Which actions are available per rule, and can they differ by tool and argument?
- How does it handle encoded, obfuscated and over-broad values, and how are rules tested?
- Does each decision record the arguments or their redacted form, the rule matched, the action, the agent identity and the input provenance, and can it be exported?
Name-level and argument-level policy are different controls
A name-level policy answers one question: may this agent invoke this tool? It is easy to write and easy to audit, but it treats every call to a permitted tool as equivalent. The risk usually sits in the values.
A published vulnerability illustrates the gap. In versions 2.8.11 and below, a database write tool executed arbitrary SQL supplied by the caller, with no semantic restrictions on the statement. The advisory notes this is consistent with the tool's name, yet it becomes a high-risk capability in an agent context. Prompt injection or indirect prompt manipulation can cause destructive statements such as DROP TABLE, TRUNCATE, DELETE or ALTER, bounded only by the database account's privileges.
The same pattern applies wherever untrusted content can shape an argument. NIST's adversarial machine learning draft describes instructions embedded in files, web pages, retrieval data or tool output hijacking an agent's later actions, including unauthorized tool calls made to exfiltrate data or escalate privileges. A name allowlist cannot see any of that. A policy decision point that receives the concrete argument values before execution can.
Which argument classes need value checks
Start by classifying tools by how open-ended their arguments are. A tool that takes a fixed enumeration needs little more than a type check. A tool that accepts free-form SQL, shell text or a URL needs rules over the content itself. Free-text payloads deserve particular attention because they can carry instructions or sensitive data to a downstream system.
These are the argument classes that most often carry risk when only the tool name is authorized:
- Identifiers and record scope: Table names, customer IDs and record keys determine whose data is read or changed.
- File paths: The path decides where a write lands or which file is read.
- URLs and hosts: Destinations determine where data is sent and what content is fetched back into context.
- Query strings and statements: Statement type and clauses matter more than the tool that carries them.
- Recipients: Email addresses, channels and accounts define who receives data.
- Amounts and request scope: Payment values, date ranges, page sizes and API scopes define the size of the action.
Structuring rules: five constructs and their limits
Most argument policy is built from a small set of constructs. Each has a failure mode, so most real rules combine more than one.
An important point on schemas: descriptions and schemas supplied by a tool provider are text placed in the agent's context, and NIST notes this makes tool metadata a possible injection channel. Treat a provider schema as a useful hint about shape, not as your security control. Your policy should carry its own constraints.
- Allowlists: Permit only known-good values, such as approved tables, directories or recipient domains. Strongest where the set is finite, but they need ownership and a change process.
- Patterns: Regular expressions suit well-defined formats. A pattern that is too loose lets bad values through, and one that is too strict blocks legitimate work. NIST's Bugs Framework treats both under-restrictive and over-restrictive validation policy as defect classes.
- Ranges: Numeric bounds on amounts, counts and limits. Check the type first, since a wrong type can break type safety even when other validation exists.
- Schema constraints: Required fields, types, maximum lengths and no unknown properties. Useful for shape, but shape is not safety.
- Context-dependent conditions: Rules that depend on the agent identity, the data classification, or where the triggering input came from. Content that arrived from a fetched page or tool output can warrant tighter limits than a direct user instruction.
Choosing the action for each rule
A rule that can only allow or block forces coarse decisions. Matching the action to the risk keeps legitimate work moving while limiting exposure. The mapping below is a starting point, not a fixed standard.
- Allow: Values fall inside an allowlist, range or pattern. Record the decision anyway.
- Redact: The call is valid but an argument carries sensitive content, such as an identifier inside a free-text payload. Remove or mask it and let the call proceed.
- Block: The value is outside the boundary, such as a destructive statement type, a path outside the permitted directory, or an unapproved recipient domain.
- Rate limit: Each call is individually valid but volume is the risk, as with repeated reads or bulk sends.
- Escalate for human approval: The action is legitimate but consequential, such as a large payment or a broad-scope request. Hold the call until a person decides.
Failure modes, testing and maintenance
Argument policy fails in predictable ways. Obfuscation and encoding are the first: the same path or host can be written with different encodings, case, separators or traversal segments, so values should be normalized and decoded to a canonical form before any pattern or allowlist is applied. Over-broad patterns are the second, where a rule written for one case quietly covers many others. Denylists are the third, since a list of bad statements or strings is easy to route around, so prefer allowing known-good values where the argument space allows it. Finally, treat every argument as potentially attacker-shaped when it could have been influenced by a file, web page or tool output.
Test each rule against both malicious and legitimate values. Keep a corpus of destructive statements, traversal paths, encoded variants and unapproved recipients that must be blocked, and a corpus of real, normal calls that must pass. Run both whenever a rule or tool changes, and review blocked and escalated calls to find rules that are too tight. Rules also need owners and a review date, because tools gain parameters over time.
Policy is one layer. Keep database accounts and credentials least-privilege, use unique non-human identities with traceable credentials, and harden the tool servers themselves. A vulnerability in one MCP framework allowed code execution from a single tool call under a default public authentication mode, which no argument rule would have compensated for.
From tool name to argument value
Name-level policy
Is this agent allowed to use this tool at all?
Argument-level policy
Are these specific values within the boundary of that tool?
Action
Allow, redact, block, rate limit or escalate for human approval.
Evidence
A record of the call, the rule matched and the outcome.
See argument-level enforcement in the execution path
Review how tool-call rules are enforced at runtime and how each decision becomes audit-ready evidence.
Request a Demo