Marketing

Sandboxing Appeal Tools So the Agent Reads but Cannot Move Money

Antonio Evans10 min read

A diagram showing three concentric zones: an inner zone labeled 'Agent tools' with icons for search, fetch.
Key points

Key points

  1. 1An appeal-review agent should be given a fixed set of callable tools, read-only access to case data, and no credential that can move money.
  2. 2Payout execution belongs in a separate service that runs only after a human approves a structured recommendation the agent wrote.
  3. 3Prompt injection through appeal text, attachments and tool output is expected, so the design must limit what a hijacked agent can do rather than assume detection will work.
  4. 4Least privilege, short-lived scoped credentials and an approval queue the agent can write to but not execute from are the controls that hold.

The threat model behind every appeal queue

Appeal review is one of the worst places to hand an autonomous agent write access. The agent reads free text that an unhappy customer, a reseller, or an attacker controls. That text is exactly the channel indirect prompt injection travels through: malicious instructions embedded in content the agent retrieves while doing its job, invisible to the user and never touching the AI interface directly Sweet Security's prompt injection guide. The OWASP cheat sheet describes the same mechanic: instructions and data arrive in the same channel, so a document saying "ignore previous instructions" is processed as a command, and when tools are connected, this reaches unauthorized actions through APIs the OWASP LLM Prompt Injection Prevention Cheat Sheet.

The important consequence for an appeal bot is a shape change. A summarizer that gets hijacked produces a misleading answer. An executor that gets hijacked sends, forwards, discloses and approves under a real employee's identity, which security engineers call the confused deputy: a program with legitimate authority is tricked by someone without that authority into using it on their behalf Bridewell's analysis of AI email agents. Appeal text is the same channel as email, and adjudication plus payout is a far more consequential action than replying.

The research position that matters for architecture is blunt: prompt injection is not solved at the model layer, and the defenses that survive are architectural, namely capability separation, least privilege per agent identity, policy enforced outside the model, and independent authorization of sensitive tool calls Bridewell. A large adversarial competition found that 46 percent of 1,433 winning attacks fell into four rhetorical shapes that transferred across unrelated domains, so testing one vertical does not cover another Lambda's write-up of the AgentBeats Security Arena. Translation for a practitioner: do not spend the quarter trying to make the model immune. Spend it making the payout unreachable.

The payments industry is converging on a parallel view. Financial institutions have historically built trust around knowing who is behind a transaction, and agentic AI adds a layer between the human and the payment that identity checks alone were not designed to handle; the question becomes whether the transaction reflects genuine human or business intent the World Economic Forum on agentic payments. Your permissions model is how you answer that question in code.

A three-tier permissions model

Write the model on one page before writing the tools. Tier 0 is the agent's own loop: it plans, reads, and writes recommendations. Tier 1 is the small set of tools it can call directly, each with narrow arguments and no side effects outside the case record. Tier 2 is data it can only read, through credentials that cannot update or delete. Tier 3 is a separate payout service the agent has no credentials for at all.

TierWhat lives thereCredential and scopeWho can execute
0: ReasoningModel calls, case state, internal scratchpadInference API key only, no business system accessThe agent
1: Callable toolsfetchOrder, getPolicyRules, getCaseHistory, draftDecision, submitForApprovalScoped function credentials per tool, task-boundThe agent
2: Read-only dataCustomer records, transaction history, prior appeals, refund ledgerDatabase role limited to SELECT on named views, short-lived tokensThe agent, read only
3: Payout servicecreateRefund, issueCredit, reverseCharge, changePayoutAccountHeld by the payout service only, never issued to the agentA human approver, through the approval UI

The model is a direct application of autonomy boundaries: a definition of what an agent may do independently, what requires human approval, and what it must never do, with access policies enforcing those boundaries and access denied by default MongoDB's governance course on autonomy, identity and access. The same source's LeafyBank example is a usable decision rule: lookups and small refunds can be delegated, refunds above a threshold route to a specialist, and actions like changing a stored payment method or closing an account remain human-only. Copy the thresholds, not the numbers.

Two scoping rules keep Tier 1 honest. First, cap each tool's arguments to the case in hand: fetchOrder takes an order ID already on the case, not an arbitrary customer ID, so the agent cannot enumerate the customer base even when injected with a tempting instruction. Second, split read and write for the same resource into different tools, because an agent allowed to look up an order should not automatically be able to modify billing information just because both functions sit behind the same API MongoDB.

A third rule is cheaper than it sounds: give the agent its own identity. Agents should authenticate as distinct principals rather than reusing user sessions or long-lived API keys, with capability-based scopes narrowing tokens to specific verbs on specific resources WorkOS on AI agent access control. When an appeal goes wrong, you revoke one principal and the rest of the support floor keeps working.

Callable tools the appeal agent may use

Keep the tool surface small enough to list in a design review. A workable set for appeal review:

  • getCase(case_id): returns the appeal, the order, the customer's masked profile, and the policy version in force.
  • fetchOrder(order_id): order lines, delivery events, and refund history for the one order on the case.
  • getPolicyRules(vertical, effective_date): the rule set, read-only, versioned.
  • getPriorAppeals(customer_id, limit): the last N decisions for this customer, with outcomes.
  • draftDecision(case_id, outcome, amount, rationale, evidence_refs): writes a structured recommendation to the case, changes no money.
  • submitForApproval(case_id): moves the draft to the approval queue and stamps the agent identity, model, prompt version and timestamp.

That is the whole loop. Notice what is missing: no issueRefund, no updateOrder, no sendEmail. Every one of those would widen the blast radius of a single successful injection, which is the failure mode that permission misuse describes, namely an agent reaching beyond its intended scope with no access review catching the overreach Dataiku on human-in-the-loop design patterns.

Above several hundred cases a day, a second opinion from a different model is cheap. Route the appeal text and the draft rationale through a summarizer model and through a different vendor's model, so that an injection tuned to one tokenizer's quirks has to beat two independent readers. Quanta Inference puts text, image, video, audio and embedding models behind one OpenAI-compatible API key (https://quantaintelligence.ai/inference), which makes the second-reader pattern a configuration change rather than a second procurement cycle. Keep the cross-check advisory: the approval decision stays with the human, not with the second model.

Tool descriptions are part of the attack surface too. A connected MCP server's tool description is untrusted input, and an agent that trusts it can be steered by whoever wrote it Bridewell. Pin tool descriptions in your own repo, hash them, and fail the deployment if the hash changes without a review.

Read-only data access that is enforced below the prompt

Sentences in a system prompt are not access control. The database has to enforce the scope, so that authorization narrows every request to the current customer or tenant and the data service refuses anything wider, with no path to read another customer's data even through a badly formed query MongoDB.

Start with a dedicated role, a dedicated user, and a set of views rather than tables.

-- Read-only role for the appeal agent's data path
CREATE ROLE appeal_agent_ro;
GRANT USAGE ON SCHEMA appeals, orders, ledger TO appeal_agent_ro;
GRANT SELECT ON appeals.v_agent_case, orders.v_agent_order,
                ledger.v_refund_history TO appeal_agent_ro;
-- No INSERT, UPDATE, DELETE, TRUNCATE or sequence grants.
-- Row scope is enforced by a policy function, not by the prompt.

Three implementation details decide whether this holds.

Row-level security, not query etiquette. Attach a policy to each view that filters on the customer or tenant carried in the request context, so the agent physically cannot retrieve rows outside the case. If your store supports it, set the scope in the session and let the engine enforce it.

Masked columns in the view, not in application code. The agent usually needs order facts and refund history, not full card numbers or home addresses. Strip them at the view layer and the question of what the model saw becomes answerable from schema.

Short-lived credentials. Prefer minute-scale token lifetimes and just-in-time issuance over long-lived secrets, and track every cache where a credential might persist WorkOS. A read-only key is still a key: if it leaks, an attacker gets a mirror of your customer table, so rotation belongs in the same sprint as the role.

Then test the boundary adversarially. Run injection payloads in an isolated sandbox with synthetic data, mock tools and logging stubs that record what the agent would have done, and judge success on whether injected text reaches a tool call, not on whether the model produced unsafe prose Sweet Security's prompt injection guide. Add a test that asserts the read-only role has no write grants, so a migration cannot quietly widen it.

The payout service behind human approval

The payout service is the only component that can move money, and it should be boring, small and slow. It exposes one endpoint, executeApprovedPayout(approval_id), which looks up a signed approval record and executes exactly what that record says. It does not accept amounts, payees or reasons from a caller, so there is nothing for an injected agent to influence.

Payout execution, ordered steps
1. Receive approval_id only.
2. Load approval record; verify signature and status = APPROVED.
3. Check the record has not expired and has not already been executed (idempotency key).
4. Compare requested amount to the policy ceiling for that vertical.
5. Re-resolve the beneficiary and payment instrument from master data.
6. Execute through the payment provider.
7. Write the result, provider reference and reviewer identity to an append-only log.
8. If any check fails, refuse and alert the review channel.

Step 5 matters because an approved record can still be turned into a payment to the wrong account if the beneficiary is taken from text someone typed. Resolve it from master data you control.

The approval record itself should capture the originating actor, the agent identity, the requested action, the case, the reviewer, the decision and the policy basis MongoDB. Evidence of human review means logs showing who reviewed, what context they saw, what they approved or rejected, when escalation occurred, and which identity the agent used; an audit trail should prove the review happened before execution Sweet Security on human oversight.

Choose the oversight pattern deliberately. Interrupt-and-resume pauses the agent at a predefined point and hands the human the proposed action with the context behind it, plus authority to approve, modify or reject; approval flows and fallback escalation cover exceptions Dataiku. For appeals, use a queue rather than a pause, so a reviewer's lunch break does not hold a worker process open.

The numbers that justify the design are simple. If your median appeal is a $40 credit and 2 percent of appeals carry injected text, a single successful payout to an attacker-controlled account costs more than the manual review time saved on the other 98 percent. That trade is why human approval belongs on the money, and why the agent's value sits in the drafting.

Making the approval real, not a rubber stamp

Human approval is a control only when it is rare, specific and backed by enforceable limits; telemetry on approval behavior suggests most confirmation designs fail that test Bridewell. A queue where reviewers click approve 400 times an hour is theater with an audit log attached. The same failure is described in the governance literature: if a support representative clicks approve on every request without checking the amount, customer, reason and evidence, the organization has created the appearance of oversight without the benefits MongoDB.

Four mechanics keep approval honest.

Draft quality over queue volume. The recommendation should carry the case facts the reviewer needs: order value, delivery evidence, policy clause cited, prior decisions, and the agent's confidence with the passages it relied on. If the reviewer has to open three systems, they will stop opening them.

Banding by amount and risk. Low-value, standard-outcome drafts can move to a sampling queue with post-hoc review. Unusual amounts, account changes and any case where the agent's draft diverges from policy go to named reviewers with the authority to reject. The pattern mirrors arrayed oversight: people do not watch every step, but they must be available at defined decision points with enough context to act quickly Menlo Security on agent oversight.

Separation of duties. The person who tunes the agent's prompts should not be the person who approves its production payouts, which is one of the five elements the governance literature lists for governed human-AI collaboration Dataiku.

Measurable approvals. Log time-to-decision and the rate of edits to the agent's draft. A reviewer who changes the amount 30 percent of the time is telling you the extraction or the policy retrieval is wrong. A reviewer who never changes anything in a month is a signal to re-train or re-band, not a sign the agent is perfect.

For teams that want the review layer built rather than assembled, an expert that reads case context and hands back a finished decision pack is a natural fit; Quanta Experts at https://quantaintelligence.ai/agents is one route, provided the payout credentials stay outside it.

Operating it: revocation, testing and limits

Three operational controls determine whether the sandbox survives contact with production.

Revocation you can actually perform. The most important control when something goes wrong is the ability to terminate an agent's access across all connected systems at once, without a per-account manual sweep Ninth Wave on agent access control in banking. Practically, that means one registry of agent identities and scopes, one revocation call, and a quarterly drill where you kill the agent mid-queue and confirm the approval path still works for humans.

Limits and circuit breakers. Agent identities should have rate limits, spend caps per period, and circuit breakers that trip on unusual volumes or off-pattern requests, and authorization decisions should be context-aware and expressed as versioned, testable policy WorkOS. A payout ceiling enforced in the payout service, not the agent, is the version that survives an injection.

A test suite built from transferred attacks. Because winning injection techniques transfer across domains, your regression set should include plausible-pretext one-liners, fake pre-approval memos, and encoding tricks, run against your actual tool schemas in a sandbox Lambda. Assert on tool calls, not text. A draft that says "recommend full refund" is a normal outcome. A createRefund call is a bug that should fail the build.

Finally, expect the review step to move human attention to higher-consequence moments as routine drafting is automated, and staff for that rather than for volume Menlo Security. The reviewer's job changes from assembling facts to judging intent, which is exactly the judgment a permissions model cannot encode.

FAQ

FAQ

What stops an injected instruction in an appeal from triggering a payout?

The payout tool is not in the agent's tool list and its credentials are never issued to the agent, so there is no call to make. The agent can write a structured recommendation and submit it to an approval queue, and the separate payout service executes only against a signed approval record with an idempotency key. Even a fully hijacked agent can at worst produce a bad recommendation that a human sees.

Should the appeal agent use a read-only database user or a filtered API?

Use both where you can. A read-only role limited to SELECT on named views removes the ability to mutate, and row-level security in the view confines every query to the case at hand. An API layer in front adds request validation and rate limits and gives you one place to revoke access, which is the control that matters most during an incident.

Is human-in-the-loop approval enough on its own?

No, because approval degrades into rubber-stamping when requests are frequent, ambiguous or lacking context. Approval is a real control only when it is rare, specific and backed by enforceable limits, and reviewers need the payee, amount, justification and agent identity in front of them. Pair the queue with amount bands, sampling, separation of duties and logs that prove what the reviewer saw before deciding.

How do I know the agent cannot reach customer records outside the case?

Test it as a boundary, not as a behavior. Grant the role access only to views scoped by a policy function, set the case scope in the session, and then attempt cross-customer reads in an isolated sandbox. If the agent can retrieve another customer's rows with a crafted query, the prompt never mattered.

Where does an agent that drafts appeal decisions fit in a team that already has support tooling?

Treat it as a drafting service inside the existing queue: it reads the case, assembles evidence, writes a recommendation, and stops. Teams that would rather not assemble the model layer or the orchestration themselves can have a specialist build the workflow alongside them at https://quantaintelligence.ai/, with the payout credentials kept in a service the agent cannot call.

Sources

Sources

  1. Prompt Injection Prevention for AI Agents
  2. LLM Prompt Injection Prevention Cheat Sheet
  3. AI Email Agents and Prompt Injection: The Company Risk ...
  4. Prompt injection doesn't care what your agent does for a ...
  5. Regulating payments when it's AI agents spending the ...
  6. Governance for AI Agents / Autonomy, Identity, and Access
  7. Best practices for AI agent access control
  8. Human-in-the-loop AI agents: design patterns for governance - Dataiku
  9. AI Agent Human Oversight: A Complete Guide
  10. Why Autonomous AI Agents Still Need Human Oversight
  11. AI Agent Access Control and Protection Platforms for Banks
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles