ai-development

No sandbox access? How to give your agent a realistic API anyway

Eran Levy Growth @ WireMock
November 19, 2026
No sandbox access? How to give your agent a realistic API anyway

You often don’t want to give a coding agent real API access due to rate limits, costs, or risky agent behavior. Sometimes the vendor has a good sandbox you can use instead; sometimes it doesn’t, or your team can’t reach it yet. Let’s look at three ways around this problem.

The task: an agent that pays invoices

We wanted an accounts-payable agent. Each week it pays our approved invoices that are due. For each one it checks our balance at U.S. Bank, sends the payment as a wire, checks the wire’s status and emails the vendor a remittance advice through Resend.

Neither API is easy to reach while you build:

  • U.S. Bank. Before you get testing access, your organization has to be verified, you file an onboarding request for each API, and you set up a mutual TLS certificate (source: U.S. Bank’s getting-started guide).
  • Resend. Until you verify a domain, Resend only sends test emails to your own address (source: Resend’s docs).

This process might take a while, and we want our coding agent to keep working. Ideally we also want the coding agent to solve the problem for itself, in a way that won’t require rework or cause failed tests down the line. What can we do?

The setup: prompt only, public sandbox, or hosted environment

We made a folder with three small files: the invoices, the vendors’ bank details and our own account. Then we gave Claude Code the same prompt in two copies of that folder. This is the full prompt:

We’re building an accounts-payable agent for our finance team. Its job: pay the approved invoices in invoices.json that are due this week (today is 18 November 2026). For each one it checks our operating account’s balance at U.S. Bank, sends the payment as a domestic wire through U.S. Bank, checks the wire’s status, and emails the vendor remittance advice through Resend.

Start with the agent’s tools, the functions the model will call: get_balance, send_wire, get_wire_status and send_remittance_email, in Python with requests. Add run.py, which calls them in order for each invoice due this week, so we can try the flow without the model. Write tests and get them passing.

We can’t reach U.S. Bank’s sandbox yet: our organization’s onboarding is still pending. Resend isn’t set up for our domain either. So you won’t have real credentials for either.

The only difference was that the second folder had an AGENTS.md pointing at the free WireMock sandboxes for the three APIs. They need no account, and any key works.

| API | Sandbox base URL |
| --------------------------------------- | -------------------------------- |
| U.S. Bank Corporate Account Information | https://98we4.wiremockapi.cloud |
| U.S. Bank Wire Transfers | https://mjmg3.wiremockapi.cloud |
| Resend | https://0dyezg.wiremockapi.cloud |
- Read each base URL from config or an env var, never hard-code it.
- Use placeholder keys. Responses are fixed examples.

Each run took about four minutes and would cost a little over a dollar, in API prices.

Then we did a third setup, where we pointed the agent’s finished code at a hosted environment in WireMock Cloud.

Let’s look at how each setup performed.

1. Fake APIs that the agent comes up with

The first run built a system that makes sense. For example, before each wire it subtracts the wires already sent in this run from the balance. But it wasn’t built around the actual APIs. It had web search and page fetching on, and it checked its Resend calls against Resend’s docs. But it didn’t manage to fetch U.S. Bank’s API reference, as the developer portal keeps it behind a login.

The result was that every U.S. Bank path and field name was a guess. It said so: each one is marked UNVERIFIED, and the live mode won’t run until someone checks them. Then it wrote fake versions of the bank to test against, built from the same guesses. All 26 tests pass - but of course, this doesn’t prove much…

Then we ran it, unchanged, against simulations of U.S. Bank’s API that were checked against the real endpoints:

Run 1 in Terminal: 26 tests pass against its own fakes, then every U.S. Bank call fails against the simulated API

What run 1 guessedWhat the API hasResult
GET /accounts/v1/{account}/balancesGET /accounts/{accountID}/balance404
POST /payments/v1/wiresPOST /transfers/domestic404
availableBalanceaccountsSummaryCurrentDay.goodFundsBalanceCrash
wireIdwireStatusDetails[0].paymentIDCrash
Statuses such as COMPLETED and SETTLEDScheduledRead as “unknown”

The first four rows break with an error, so you’d notice. The last one doesn’t. Even with the paths and field names fixed, the agent doesn’t recognise the status Scheduled, so it never treats a wire as confirmed. And it only emails a vendor after a confirmed wire. So no vendor would ever get a remittance advice, no error would show, and none of the 26 tests would catch it.

2. A public WireMock sandbox

The second run started the same way, by reading the files. Then, before writing any code, it read the three sandbox pages and called each API with curl:

Terminal window
curl https://98we4.wiremockapi.cloud/accounts/000123456789/balance
curl -X POST https://mjmg3.wiremockapi.cloud/transfers/domestic -d '{}'
curl https://mjmg3.wiremockapi.cloud/transfers/<paymentID>

Those calls answered the questions run 1 had to guess at:

  • Where the balance is. One level down, under accountsSummaryCurrentDay, as goodFundsBalance.
  • What a new wire returns. A 201 with a wireStatusDetails list holding the paymentID and a transactionStatus of Scheduled.
  • What an unknown wire returns. A 404 with an error code in U.S. Bank’s format, which it turned into a clear “wire not found” message.

So its tools read the fields as they are:

summary = resp.json().get("accountsSummaryCurrentDay") or {}
balance = summary["goodFundsBalance"]
details = resp.json()["wireStatusDetails"][0]
payment_id = details["paymentID"]
status = details["transactionStatus"] # "Scheduled"

It wrote 27 unit tests, plus one test that runs the whole flow against the sandboxes. Then it ran run.py against them for real. Here’s that run, filtered down to the key lines:

Run 2 in Terminal: two invoices wired and two remittance emails sent through the public sandboxes

It skipped INV-2214, due next week, and INV-2216, which isn’t approved yet. A second run sent nothing, because both invoices were already in the ledger.

It also listed what the sandbox couldn’t tell it:

  • The wire request body. The shared sandbox accepts any body, so it built the request from the shape of the wire record it got back. Your own copy can check it, as the next section shows.
  • Sign-in. U.S. Bank uses OAuth with an API key and a secret. For now the tools send a placeholder token.
  • The wire record is a fixed example. Every lookup returns the same $15.24 payment in Canadian dollars to “Jane Doe”, so the agent warns about a mismatch on every invoice. It asked us whether a mismatch should stop the email.

A public sandbox is the quickest way in: no account, no keys, and your agent is calling something realistic within seconds. However, it is shared and fixed. Every account there holds the same $240 million, and every wire lookup returns the same example payment. It keeps some state, such as the wire IDs it hands out, but everyone using it shares that state. You can’t change a response, and you can’t see the requests your agent sent.

3. Your own hosted environment

To test what happens when money runs short, you need a balance you can set yourself, which means your own copy. With the WireMock MCP server connected, that’s one extra request to your coding agent:

Create a WireMock Cloud environment called ap-agent-dev from the U.S. Bank Corporate Account Information, U.S. Bank Wire Transfers and Resend templates.

It comes back with three private base URLs. The code doesn’t change, only the config:

The ap-agent-dev environment in WireMock Cloud: three mock APIs, each made from a template

Terminal window
# .env.example: the shared sandboxes
USBANK_ACCOUNTS_BASE_URL=https://98we4.wiremockapi.cloud
USBANK_WIRES_BASE_URL=https://mjmg3.wiremockapi.cloud
RESEND_BASE_URL=https://0dyezg.wiremockapi.cloud
# .env.dev: your own copy
USBANK_ACCOUNTS_BASE_URL=https://<your-accounts-id>.wiremockapi.cloud
USBANK_WIRES_BASE_URL=https://<your-wires-id>.wiremockapi.cloud
RESEND_BASE_URL=https://<your-resend-id>.wiremockapi.cloud

Next, we set our own balance. We edited the balance response in our copy so it returns $20,000, a little less than the $22,650.50 due this week. Nothing else in the templates changed.

The balance response in our copy, with goodFundsBalance set to 20000.00

We reran run 2’s agent. It wired $18,450 to Northwind Freight, checked the balance again, saw $20,000 again, and wired $4,200.50 to Brightline: $22,650.50 out of a $20,000 account. The code trusts the bank’s balance to drop the moment a wire is sent. A scheduled wire may not show in the balance straight away, and when it doesn’t, the second check passes.

The hosted environment in Terminal: a $20,000 balance, and both wires go out against the same $20,000

The fix is small: count the wires already sent in this run. But you only find the bug when you can set the balance yourself.

Your own copy also keeps a log of every request, checked against the API’s OpenAPI spec. That settled one of run 2’s open questions. Its wire request wraps everything in a wireTransfers object, copied from the wire record it got back. The spec wants customerIdentifiers and transfers at the top level, plus a Correlation-ID header. The shared sandbox had answered the same request with a 201.

The request log flags run 2's wire request: two required properties and a required header are missing

The three side by side

Fakes the agent imaginesPublic sandboxYour own hosted environment
SetupNoneNone: no account, no keysOne request through the WireMock MCP
Realistic responsesNo, guessed from memoryYesYes
Your own data and scenariosWhatever the agent writesNo, the same data for everyoneYes, change any response
StateOnly what the agent builds in: run 1’s fake bank lowered its balance after each wireSome, shared with everyone: it remembers the wire IDs it hands outYours alone: it keeps each wire by ID, and you can add more, like a balance that drops
See what your agent sentOnly in its own testsNoYes, checked against the API’s spec
PrivateYesNo, it’s publicYes

All three can hold some state. What changes is whose state it is, how close it is to the real API, and whether you can shape it.

What to take from this

  • Fakes the agent imagines cost nothing and the logic can be good, but the tests only prove that the code agrees with its own guesses.
  • A public sandbox catches wrong paths, field names and status values in minutes, with no login. You can’t shape it to your case.
  • Your own hosted environment lets you set up the cases your business cares about, like a balance that won’t cover this week’s invoices, and shows every request your agent sent, checked against the API’s spec.

Try it with WireMock

  • Start free, no sign-up: every API on wiremock.io/sandboxes has a shared sandbox URL you can give your agent today.
  • Make your own copy in WireMock Cloud when you need your own data, balances or failures.
  • Let your agent set it up through the WireMock MCP server, so the environment is one request away.

Have More Questions?

Explore the docs or get in touch with our team.