handleAdjustCardLimit forwarded the model-supplied card_id straight to
gateway.AdjustCardLimit with no check that the card belongs to the
tenant this decision cycle is for. BuildToolSchemas's own doc comment
claims tenant_id is deliberately never a model parameter "so the model
can never redirect an action at another tenant" — true for
ration_bridge_funding/issue_card/notify_tenant (all pass tc.TenantID
explicitly), false for adjust_card_limit, whose only tenant binding is
an indirect card_id->tenant lookup that gateway's own tenantauth
interceptor explicitly skips for an operator credential (exactly what
this agent always authenticates as). A hallucinated or
prompt-injected card_id (e.g. via the tenant-controlled TenantName
field already rendered verbatim into the prompt) could silently
tighten or loosen ANY tenant's card limit.
Reproduced live against the real bare-metal stack (ledger-core, auth,
tenant-registry, card-issuance, gateway): minted the agent's real
operator JWT, called the real exported tool handler with tenant A's
TenantID but tenant B's real card_id — tenant B's card limit dropped
from 1,000.00 EUR to 0.00 EUR and flipped to RATIONED, with zero
errors anywhere in the chain. Fix: resolve the card via gateway.GetCard
first and decline (recording a real DECLINE audit entry) when its
tenant_id doesn't match tc.TenantID. Re-ran the identical repro
post-fix: cross-tenant attempt now rejected with the card untouched;
same-tenant adjustment still succeeds normally.
go build/vet/test clean for every go.work module; 0 regressions.