Two pizzas arrive, but you tried to order one

You phone a pizza place. The line drops before you hear whether they took your order. You call back and order again.

Two pizzas arrive, but you tried to order one. ๐Ÿ•๐Ÿ•

Now suppose an AI wrote the program placing the order. It says the job is done. How do you know whether the kitchen got one order or two?

You could try the program against a fake shop and count the orders. That would tell you more than asking the AI whether its code works. But you still have to run code you don't trust. You don't want it holding the shop's password or calling whatever it likes.

plimsoll is the sandbox service I built for running that code. In this example, the code gets no direct internet access and no vendor password. A separate program, the broker, checks its requests against the operations you allowed and adds the credential before passing them on.

The kitchen has two tickets

The actual example uses warehouse robots. The AI-written program is an adapter: it turns the business's jobs into requests to the robot company. The company is a simulator, so these trials move no real robots.

One trial goes like this. The company accepts a job, but the adapter gets an error instead of the confirmation. The first adapter sends the job again. The company accepts it again. The robot makes the same trip twice.

The second adapter sends an order number with its first request and reuses it when it retries. The company recognises the number and returns the original job. The robot goes once. That number is an idempotency key, a way to say "this is the same order, even though I'm asking again". It is a standard technique; Stripe's explanation (EXTERNAL ยท official docs โ†—) ↗ describes the same idea for payments.

Both adapters report that the jobs are done. The company's own list of accepted jobs tells us which one ordered twice. Think of the tickets hanging over a pizza kitchen's counter: there are two tickets for the same meal, whatever the caller says.

You can watch it happen. Open the first adapter's run (INTERNAL ยท robot replay โ†’), press Play, and watch robot r2 make its extra trip. Then open the second adapter's run (INTERNAL ยท robot replay โ†’). It goes once.

What plimsoll does while the code runs

Ordering twice is a mistake an allowed program can make. The sandbox does not understand that you meant one pizza. The test catches it by comparing the adapter's answer with the company's records.

plimsoll handles a different part of running the program. In this setup, the adapter can request a job and check its progress. It cannot use the broker to delete a robot or change its software, because those operations were not granted. The broker checks even a raw request that bypasses the supplied client. The vendor credential stays outside the sandbox.

The adapter runs in a sandbox. Outside it, the broker permits selected operations and adds the credential before sending a request to the simulated vendor. The example's separate test compares the adapter's report with the vendor's ledger. INSIDE THE SANDBOX AI-written adapter No vendor credential No direct internet here OUTSIDE SANDBOX Broker Checks each operation Adds the credential SIMULATED VENDOR Robot company Accepts jobs Keeps its own ledger THE EXAMPLE'S TEST Compare the adapter's report with the jobs the vendor actually accepted.
The adapter runs inside the sandbox. The broker checks allowed operations and adds the vendor credential outside it. The example's separate test checks the vendor's ledger.

You can find the duplicate-order bug before this adapter gets real work, while restricting what its code can reach during the trial. Those access restrictions can also stay in place when you use it. They do not make every permitted request a good one. Connecting a real vendor and writing the checks are still your work.

A sandbox, a proxy that adds credentials, and some logging can be assembled into a system like this. plimsoll packages the execution service, the rules for vendor access, and checked run records. The example adds the fake robot company and the program that checks its ledger. Whether that saves you work depends on what you already have.

Sometimes the answer is "I don't know"

Another trial has the company accept the job and then stop answering questions about it. The adapter cannot establish what happened. Saying "the order failed" would invite someone to send it again.

The second adapter reports that the outcome is unresolved. The test accepts that answer. An honest account of what remains unknown is useful here; a confident guess can put another ticket in the kitchen.

The receipt

The example also uses a recorder outside plimsoll to sign the run records, and it signs each test verdict with the evidence used to reach it. Someone else can check the saved files, detect changes, and recompute the verdict.

The signature protects the saved account from alteration. It does not make the account true by itself. The checks still depend on the simulator, the test, and the machine running them. The broker records call details such as the operation and response status, rather than a full copy of every vendor request and response.

This example uses a simulated vendor and gVisor, an extra kernel boundary between the code and the host machine. Its evidence comes from configuration and checks, not a hardware proof of what ran. It shows a way to restrict and test an adapter, not that the adapter is ready for every situation a real vendor might produce.

Open the two replays and press Play. In the first, r2 makes the same trip twice. In the second, it goes once. Both adapters said they were done.