
The Code Changed. What Does the Old Approval Recognize?
Two functions contain different code yet receive the same tool identity string. Keep their module, qualified name and exposed name unchanged, and the identity getter in our isolated probe cannot distinguish them. This is not an authorization incident, but it raises a concrete question: does an old approval recognize a name, code content or this particular operation? The reuse key determines the answer. Comparing two implementations with controlled probes helps identify which changes should invalidate an earlier decision.
Three associations that answer different questions
Does a human reply answer the right question? Does an earlier grant cover the current operation? Does a resumed execution reconnect to the right waiting request? A single approval interaction can involve three separate identity relations.
We compare the tool-approval middleware of AG2, an open-source agent application framework, with the pre-action approval lookup in SIDJUA, an agent-operation governance system. They have independent authors and provide primary evidence for their respective implementations. Neither independently reproduces or validates the other's security. Our probes exercise only an identity getter and a database query.
| Check | Question it answers | What it does not establish |
|---|---|---|
| Human-reply correlation | Which question received this answer? | Whether a grant covers different arguments |
| Grant-reuse lookup | Does this call fall within an existing grant? | Whether the final tool executes or is safe |
| Pause/resume correlation | Which waiting request should continue? | Whether the grant lookup uses that same request boundary |
This is our analytical distinction, not a shared interface contract of the projects. A reply may be correlated by a parent message ID, and a pause by a request ID in stored metadata. The grant lookup between them still needs its own inspection.
Distinguishing names is not binding code content
In the pinned AG2 approval middleware, the grant key uses the call event's source identity, falling back to its name if the source is absent. An “always” answer stores that key in context variables. A later match invokes the continuation without asking again. Arguments may appear in the question shown to the human, but are absent from the reuse key.
The tool identity getter constructs a string from the callable's module, qualified name and exposed tool name. The registration entry point supplies that source on a copy of the event before middleware execution. Different qualified names can distinguish two functions exposed under the same name. This is not a digest of code content.
Our internal experiment, executed in the same day's Analysis, extracted the actual getter from the source AST, removed only its property decorator and invoked it with synthetic owners and callables. The identity results retain all three cases. This article reuses that record; Production did not rerun the experiment.
| Changed dimension | Equal identity strings? | Bounded observation |
|---|---|---|
| Same exposed name, different callable qualified name | No | These callable identities are separated |
| Different function body, same module, qualified name and exposed name | Yes | The key does not bind body content |
| Same callable, different exposed alias | No | The exposed name participates in identity |
The maintainer tests also assert separation of same-name functions, reuse on later turns and reuse after serializing context variables and rebuilding the tool. We read those tests; we did not execute them. Their asserted behavior does not conflict with the three isolated cases: separating qualified names does not establish that arbitrary replacement code invalidates a grant.
Lifetime is a separate dimension. The human-input context waits for a reply with the matching parent ID, applying a timeout to both sending the question and waiting for the answer. Expiry ends the turn as a human-input error. This limits the wait, not the lifetime of an “always” grant. The approval middleware implements no grant TTL, revocation or argument binding. Disabling “always” ignores existing bypass flags; that switch is not a complete revocation protocol.
Stored request identity is not a lookup predicate
The pinned SIDJUA approval source stores the request ID in metadata when creating an approval request. Its lookup comment describes request-ID matching and a compatibility fallback, but the executable query never uses that ID. This excerpt preserves the predicates and ordering while omitting returned columns. It is a reformatted source excerpt, not a proposed API.
FROM approval_queue
WHERE agent_id = ?
AND rule_triggered = ?
AND status IN ('pending', 'approved', 'denied')
AND created_at > datetime('now', ? || ' hours')
ORDER BY created_at DESC
LIMIT 1The supplied parameters are agent identity, workflow action pattern and an age window. Target and request ID are not compared by this lookup. The window uses creation time, rather than starting a fresh clock when an approval decision is made.
The internal experiment executed the exact extracted query in SQLite with explicitly synthetic requests and rows. The evidence guide and query results retain the predicate, controls and rerun instructions. This was not a complete project run that attempted an external operation.
| Control | Retrieved row or result |
|---|---|
| Original request A | A's approved row |
| Request B and changed target, other conditions unchanged | Still A's approved row |
| Changed agent only | No row |
| Changed workflow action pattern only | No row |
| Original row outside the age window | No row |
| Pending row, changed request | Original pending row |
| Denied row, changed request | Original denied row |
| Row changed to an excluded cancelled status | No row |
| Add a newer eligible denied row | New row wins over the old approval |
There are eight single-row controls and one newest-row control, nine in total. Request and target changes are changes to experimental request metadata; neither is a comparison parameter accepted by the query. The result does not show a complete request validator accepting B. The age case was deliberately far from the cutoff, so exact timestamp-boundary behavior remains untested.
The pre-action pipeline shows a different relation: approval PAUSE or BLOCK short-circuits the pipeline, and the separate lookup used to obtain a pending approval ID for a pause does compare the metadata request ID. Resume bookkeeping can be request-specific while grant reuse follows broader predicates. An approval-stage pass also continues to budget, classification and policy checks, so finding an approved row is not sufficient for a final operation allowance.
Write the reuse boundary as a falsifiable contract
Our interpretation is that reuse defines a set of calls treated as equivalent for a decision. AG2 primarily groups by a tool identity string and context state; this SIDJUA lookup groups by agent, rule and creation-time window. Whether that scope should be narrow or broad depends on what the approver agreed to, rather than how precise an identifier sounds.
A counterexample is repeated low-risk work within one workflow. An operator may intentionally authorize many requests at once, and asking again for every occurrence may add friction. Broader reuse is therefore not automatically a vulnerability. The issue is whether the product promise, executable conditions and test expectations agree. If the contract authorizes only target A while the lookup never compares targets, either the implementation or the stated scope needs to change.
Using an approved request A for target A as the running example, reviewers can collect evidence along this responsibility chain. It is a proposed review method, not a process already shared by both projects.
| Stage | Input and responsible party | Required output | Stop or ask again when |
|---|---|---|---|
| Construct operation | Caller supplies target, arguments and state; trusted entry checks identity | Attributable operation request | Identity or preconditions are uncertain |
| Present approval | Interface shows scope; human decides | Decision with scope and lifetime | Displayed and actual operations differ |
| Store decision | Authorization storage records scope evidence | Inspectable grant record | Record is missing or corrupt |
| Look up again | Authorization layer receives request B for target B | Match rationale or a new question | Change exceeds the agreed equivalence relation |
| Resume | Resume layer retrieves waiting request and grant | Current continue/deny decision | Request, policy or preconditions changed |
| Execute | Tool boundary rechecks current authority | Actual effects and result evidence | Revocation, repeated consumption or isolation violates the contract |
Change one dimension at a time: request ID, target, arguments, body content, policy revision, preconditions, time or restored context. Record whether the design intends reuse or a new question before exercising the real entry point. Matching an existing query is not synonymous with matching user authority. Also inspect one-time consumption, network replay and process, container or operating-system enforcement separately. We did not verify these capabilities; an application-layer allowance cannot establish that they exist.
Evidence and unfinished verification
Three evidence roles remain separate. Public source supports facts about the pinned implementation. Maintainer tests express the authors' intended assertions. Internal experiments show our execution of an isolated query or function; they are neither independent third-party reproduction nor whole-system security validation. The comparison and review method are our interpretations.
Sources are pinned to AG2 commit 10809bf298ff7c5c5a5c830651070c6f6634f90f and SIDJUA commit 747b5bb125c8cc94e7cb99a581dc63bedb2c9bb2, with local source verification on the research date. We do not claim later versions behave identically. AG2ai maintainers provide the middleware, identity and context source and the author-written approval tests; Götz Kohlberg provides the SIDJUA approval and pipeline source. Links above identify the relevant file at its pinned revision. Publication or citation status adds no validation strength.
The internal SQL probe used SQLite 3.53.3 with Node 24.19.0; the identity probe used Python 3.12.9. The proposed public evidence index preserves results, source checksums, environment and synthetic controls, declaring its redactions. It is an attachment prepared for this candidate, not a claim that the article has been released.
No complete approval middleware, real human interaction, context restoration, transport merge, matcher, condition parser, decision writer, resume-token verifier or external tool was executed. We measured no real side effect and established no attacker control of identities. Reading a variable-filtering function does not audit all transport entry points. Framework-wide exploitability, revocation guarantees, concurrent one-time consumption and operating-system isolation remain outside this evidence.
The next step is to establish maintainer intent, then use trusted request construction and actual resume entry points to check changed requests and targets, old decisions after code updates, propagation of denials and expiry, and effects of repeated calls. Until then, the supported finding is the boundary of two reuse keys, rather than a verdict on whole-system security.