Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Agreed, any drift in the arguments should invalidate the token. I also bind the hash to the tool name, tenant and an idempotency key, so a legitimate retry reuses the same approved token while a changed amount or target forces a fresh approval.
Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Exactly. The approval token is scoped to the idempotency key with a short TTL, so a retry inside that window reuses the same approval instead of paging a human again. The gateway also records every execution against that key, so a duplicate side effect gets rejected outright rather than re-approved.
Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Agreed. A rejected duplicate also leaves a clean audit trail, so when something does retry you can see it was caught instead of wondering whether it ran twice. Thanks for pushing on this, Odinaka.
Custom software & AI development company. We build production-ready AI integrations, mobile apps, and web platforms for businesses that want real results. lycore.com
Separating read, write and destructive tiers in the gateway is the right shape, since the tool worker never decides its own permissions. One thing that has helped in practice is binding the approval to a hash of the exact arguments, so an approver can't approve one refund and have a different amount executed after a retry. I'd also log the retrieved context ids alongside each tool call, because that makes it much easier to trace which document carried an injected instruction. How do you handle approval timeouts: fail closed, or let the agent re-propose?
Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Thanks, this is a great addition. Binding the approval to an argument hash is exactly the kind of guarantee a gateway should enforce, and logging the retrieved context ids per call is something I'd now call essential for tracing injected instructions back to their source document. On timeouts, I fail closed with a short TTL (around 15 minutes). An expired approval cancels the pending call outright. The agent can re-propose, but only as a brand-new request with a fresh argument hash and the original context ids attached, so the approver sees it as a new decision. Nothing ever auto-retries past an expired approval.
@muhammadalimughal The tool schema list rides along on every turn, so it is easy to overlook. Filter it: expose only the tools for the current role, so a read-only session never sees the write schemas. That cuts tokens and shrinks what a prompt injection can reach. Log schema tokens per request before optimizing anything else.
Sandboxing, schemas, and approval gates work best as one chain: schema validation limits the request, the sandbox limits the environment, and approval limits the authorized effect. The verification step after execution is the missing fourth link that proves the chain produced the intended state.
Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Agreed, and verification is the link teams most often skip. In practice I have the gateway re-read the target state after execution (the refund record, the file diff, the affected row count) and compare it with what the approved arguments said should happen. A mismatch gets logged as an incident instead of a silent success, which closes the loop the approval opened.
Principal Software Engineer building and scaling enterprise-grade systems since 2017 - across InsuranceTech, Fintech, SaaS, E-commerce, and Government. I don't just write code - I own systems. From ar
Good call, the tool schema list is easy to overlook because it rides along on every turn. Filtering is the approach I recommend: expose only the tools scoped to the current tenant, role and approval tier, so a read-only session never even sees the write or destructive schemas. That cuts tokens and also shrinks what a prompt injection can reach for. Keep descriptions tight and log schema tokens per request so you can see the cost before optimizing anything else.
We're a place where coders share, stay up-to-date and grow their careers.
The argument-hash binding for tier-3 approvals is the part to copy. A changed refund amount after approval should kill the token, not slide through.
Agreed, any drift in the arguments should invalidate the token. I also bind the hash to the tool name, tenant and an idempotency key, so a legitimate retry reuses the same approved token while a changed amount or target forces a fresh approval.
Binding the idempotency key in there is the useful bit. A retry should not need a second human to say yes again.
Exactly. The approval token is scoped to the idempotency key with a short TTL, so a retry inside that window reuses the same approval instead of paging a human again. The gateway also records every execution against that key, so a duplicate side effect gets rejected outright rather than re-approved.
That gateway recording detail is the part that sells it. A duplicate getting rejected outright beats a second approval prompt every time.
Agreed. A rejected duplicate also leaves a clean audit trail, so when something does retry you can see it was caught instead of wondering whether it ran twice. Thanks for pushing on this, Odinaka.
Separating read, write and destructive tiers in the gateway is the right shape, since the tool worker never decides its own permissions. One thing that has helped in practice is binding the approval to a hash of the exact arguments, so an approver can't approve one refund and have a different amount executed after a retry. I'd also log the retrieved context ids alongside each tool call, because that makes it much easier to trace which document carried an injected instruction. How do you handle approval timeouts: fail closed, or let the agent re-propose?
Thanks, this is a great addition. Binding the approval to an argument hash is exactly the kind of guarantee a gateway should enforce, and logging the retrieved context ids per call is something I'd now call essential for tracing injected instructions back to their source document. On timeouts, I fail closed with a short TTL (around 15 minutes). An expired approval cancels the pending call outright. The agent can re-propose, but only as a brand-new request with a fresh argument hash and the original context ids attached, so the approver sees it as a new decision. Nothing ever auto-retries past an expired approval.
@muhammadalimughal The tool schema list rides along on every turn, so it is easy to overlook. Filter it: expose only the tools for the current role, so a read-only session never sees the write schemas. That cuts tokens and shrinks what a prompt injection can reach. Log schema tokens per request before optimizing anything else.
Sandboxing, schemas, and approval gates work best as one chain: schema validation limits the request, the sandbox limits the environment, and approval limits the authorized effect. The verification step after execution is the missing fourth link that proves the chain produced the intended state.
Agreed, and verification is the link teams most often skip. In practice I have the gateway re-read the target state after execution (the refund record, the file diff, the affected row count) and compare it with what the approved arguments said should happen. A mismatch gets logged as an incident instead of a silent success, which closes the loop the approval opened.
A server sends its whole schema list with each request unless it filters it, so measure that before anything else. Does yours filter it?
Good call, the tool schema list is easy to overlook because it rides along on every turn. Filtering is the approach I recommend: expose only the tools scoped to the current tenant, role and approval tier, so a read-only session never even sees the write or destructive schemas. That cuts tokens and also shrinks what a prompt injection can reach for. Keep descriptions tight and log schema tokens per request so you can see the cost before optimizing anything else.