Why does tool-call argument validation that checks type, length and format pass an attacker-written value?
answer
- the checker sees a string, not a source
- well formed is not the same as chosen
- format constrains the set, not the pick
- validity is about the value, authority its origin
basics
~10 sBecause it judges the string, and the objection is about the string's origin. Type, length and format are properties a value has on its own, so a correctly formed identifier passes whoever wrote it.
solid answer
~50 sArgument validation answers 'is this a permissible value of this kind?'. The complaint in this class is 'is this the value the requester chose?'. Those are different predicates over different inputs. A validator sees a string, a declared type and a rule; it does not see a source, an author or a chain of custody, so nothing in its inputs could distinguish an account identifier the purchase order specified from an equally well-formed one an outside party wrote onto the invoice. Tightening the format does not help, because the attacker's value is already well formed — a self-consistent identifier format is self-consistent for anyone who wants to produce one. Range and amount limits bound magnitude but say nothing about beneficiary. Enumerations behave slightly better, since every admissible member is pre-sanctioned, but if two members differ in consequence then picking between them is still a free choice the validator cannot adjudicate.
go deeper
Hold on to one sentence: a value can be perfectly valid and still be one nobody with authority chose. Validation checks the value, not where it came from.
Explain what inputs a validator actually receives and why provenance is not among them. Be ready to say why self-verifying identifier formats give the attacker no trouble at all.
Show judgment about which arguments are genuinely reducible — narrow enumerations with flat consequence — and which are free choices where shape is all any checker on that path can test.
Be able to say plainly that a validation pass is being read as an assurance it never offered, and what your organisation has actually been claiming when it cites schema conformance.
## Validity is a property of the value; authority is a property of its origin ### What an argument validator actually has in front of it When a tool call is validated, the checker is handed a value and a rule. The rule expresses admissible *shape*: this must be a string, of this length, matching this pattern, drawn from this set, within this range, satisfying this checksum. The checker evaluates the rule against the value and returns pass or fail. Now look at what is *not* in front of it. Not who authored the value. Not which stage of the pipeline produced it. Not whether it came from an internal record or from a document an outside party submitted this morning. Provenance is simply not an input to the function, so no configuration of the function can be sensitive to it. This is not a weak validator or a badly written schema; it is a category difference between the question the layer answers and the question in dispute. ### Two predicates, easily confused - **Validity**: does this value belong to the set of values this argument may take? Determined entirely by the value. - **Authority**: is this the value that the party entitled to choose it actually chose? Determined entirely by where it came from. A value can be perfectly valid and completely unauthorised. That sentence is the leaf. Everything else follows from it. ### Why a stricter format does not move the needle The instinct on seeing this class is to tighten the rule. It rarely buys anything, and it is worth being able to say why. Identifier formats — account strings, reference numbers, structured codes — are designed to be *self-verifying*: a checksum or a fixed structure lets any consumer confirm the string is well formed without consulting anyone. That property is a feature for the legitimate ecosystem and it is available symmetrically. Anyone with an account of their own has a well-formed identifier for it. A stronger format check makes the attacker's value *more* obviously correct, not less. The rule constrains the set of expressible values; the attacker only needed a value inside that set all along. Amount and range limits are worth separating out. They genuinely constrain magnitude, so they bound what a single instance is worth — but a payment within policy is exactly the shape of instance this class produces, and the beneficiary field is untouched by any bound on the amount. ### Enumerations are the interesting case An enumerated argument behaves better than a free-form identifier, because every admissible member was sanctioned in advance by whoever wrote the enumeration. The attacker cannot introduce a new member; the value space is closed. That is a real reduction, and it is not immunity. If two members of the enumeration differ in consequence — a scope that covers one record against one that covers a class of them, a mode that notifies against one that does not — then choosing between sanctioned members is still a choice, and the validator has no basis to prefer one. The narrower the enumeration and the flatter the consequence across its members, the less there is to influence. ### What this is not This is not a value that fails the schema. An out-of-enumeration string, an invented identifier that resolves to nothing, a type mismatch — those are accuracy and reliability defects, they are caught by exactly the layer under discussion, and they belong to a different subject. The whole difficulty here is that the value is in-specification *by construction*, because being in-specification is what lets it reach the operation at all. Nor is it an escape into another interpreter — no quoting boundary is crossed and the value is consumed as a value. And it is not a claim about the validator being poorly built. The best-written schema in the world evaluates the string. ### Where a check on an argument does bite It bites where the admissible set for this call is not a general rule but a specific one derived from state the outside party did not author — for instance, where the value must correspond to something already fixed by the request that opened the workflow. Then the comparison is against a source rather than a shape, and the property being tested is finally the one in dispute. That is a statement about where the class stops working, not a recipe: wherever the argument's value is a free choice constrained only by form, form is all any checker on that path can test. ### Direction of the claim A validation pass proves the value satisfied a shape rule. It does not prove the value is correct, does not prove anyone with authority selected it, and does not prove the operation will land where the requester intended.
- Would a stricter format rule on that argument have caught it?No, and it slightly helps the attacker. Identifier formats are self-verifying by design, so anyone can produce a correct one for an account they control. A tighter rule narrows the expressible set, and the attacker's value was already inside it. Format work is worth doing for correctness; it does not address who chose the value.
- Does an enumerated argument close this off?It narrows it, because every admissible member was sanctioned in advance and no new member can be introduced. It does not close it if the members differ in consequence — choosing among sanctioned options is still a choice, and shape validation has no basis to prefer one. The flatter the consequence across the enumeration, the less remains.
- How is this different from a tool call arriving with an identifier that does not exist?That is a reliability defect and the schema layer is exactly what catches it — the value fails to resolve. Here the value resolves perfectly and belongs to somebody; that is why it passed. Filing the two under one heading loses the distinction that matters, because one is fixed by better validation and the other is not.
A bank teller can confirm an account number is a real, correctly checksummed account number. That check can never tell them it is the account you meant.
saying these in an interview costs you the question
- Proposes a tighter regex as the answer to an already well-formed value
- Treats schema conformance as evidence the value was intended
- Confuses this with an out-of-enumeration or hallucinated identifier
- Claims a checksum proves the identifier is the right one
- Thinks amount limits constrain who the beneficiary is