2026-11-27 16:21 UTC

Doozy says its agent uses a gateway to keep production keys out of task sandboxes

state: expiredheat: lowuncertainty: mediumrelevance: mediumagent-security credential-brokering sandboxing prompt-injectionShiv Sarthak SabhlokDoozy

What is this?

On 27 October 2026, Doozy founder Shiv Sarthak Sabhlok described the company’s security design for an AI agent that works with customer databases and services such as Stripe and GitHub. In the account, each task runs in a disposable sandbox with a short-lived, signed job token rather than production API keys; an external gateway checks authorization and attaches credentials to individual calls. The post also describes controls including default-off risky tools, read-only SQL limits and action logs. Sabhlok says this reduces credential-leak risk, but does not stop prompt injection from misusing enabled tools or exfiltrating data the agent can access. He acknowledges that secrets explicitly requested into the sandbox can still be exposed. These are first-party descriptions, not independent verification of the implementation or its effectiveness.

Why it matters

This is a concrete example of designing agent access around a credential gateway rather than placing production keys inside the model’s execution environment. The pattern can reduce the damage from stolen keys as more agents interact with real business systems, but it does not stop an injected agent from misusing tools it is authorized to use or exposing data it can read. The post’s value is its candid account of the remaining risks and controls, not evidence that the approach is novel or independently proven.

Current assessment

On 27 October 2026, Doozy founder Shiv Sarthak Sabhlok published a first-party description of the security architecture for its Slack-based agent, which can query customer databases and connect to services including Stripe and GitHub. He says tasks run in disposable sandboxes holding short-lived, signed job tokens, while an external gateway validates each call and attaches the relevant stored credential. The post also describes risky tools being off by default, database queries constrained to read-only transactions with timeouts and row limits, and action receipts and audit logs. Sabhlok explicitly says this does not prevent prompt injection from abusing enabled tools, reading accessible data and sending it to public URLs; secrets deliberately handed into the sandbox may also be exposed. The design and its safeguards are company claims, not independently verified evidence of implementation or effectiveness. The broader implication is that credential isolation can narrow one important failure mode, while permissions, data access, outbound communication and human oversight remain central agent-security problems. The supplied search results show similar credential-proxy patterns discussed elsewhere, but do not independently validate Doozy’s system.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-26 13:00⭐ origin echo-reconstructedDoozy's account describes fresh per-task sandboxes holding signed job tokens rather than API keys; an external gateway checks authorization
Shiv Sarthak Sabhlok on blog (echo) · attributed from hn.story.50256835
—
10-27 10:10first on hacker news · published · +21.2hKeeping API keys out of our AI agent's sandbox, and what that doesn't solve
shivsarthak
—
10-27 10:10amplified on hacker news 👑hn.story.50256835
shivsarthak
peak 1 · 0 comments · 105% of case engagement
10-27 10:27our radar first saw it · +21.4hdiscovery anchor: hn.story.50256835—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnKeeping API keys out of our AI agent's sandbox, and what that doesn't solve
Retrieved article excerpt

Open article · Retrieved 2026-10-27T10:28:42.411198+00:00

# Keeping API keys out of our AI agent's sandbox, and what that doesn't solve

Doozy runs tasks against our customers' databases, Stripe and GitHub from a Slack thread. Here's how the agent does that without ever holding a key, and the risks a missing key doesn't remove.

SS

[Shiv Sarthak Sabhlok](https://github.com/shivsarthak)27 October 2026 · 9 min read

- AI agent security
- Prompt injection
- Credentials
- Postgres
- Slack

Doozy is an AI agent people mention in Slack. Someone writes "@Doozy why was Acme charged twice?" in a support thread, and it goes and checks: it queries the [database](https://askdoozy.com/integrations/postgres), reads [Stripe](https://askdoozy.com/integrations/stripe), looks at the code in [GitHub](https://askdoozy.com/integrations/github), and posts what it found back in the thread.

So the first question every engineer asks me is about AI agent security, and it's the right one: you're giving an LLM production credentials? This is the long answer. Most of it is deliberately boring. The interesting part is what's left over once the keys are gone.

The short version

The agent never holds an API key. Each task runs in a fresh sandbox that holds only a signed, short-lived job token. A credential proxy outside the sandbox checks that token, decides whether the tool is allowed, and adds the real key to that one call. Database queries run read-only, with a timeout and a row cap. That stops keys leaking. It doesn't stop prompt injection misusing the tools you've switched on, so those are the controls that matter most.

## Why our AI agent never holds API keys

Every task runs in its own sandbox, a small VM that exists for that one job and is thrown away after. Nothing in it is a credential for your systems. No API keys, no database password, no model provider key, no GitHub token.

When the agent needs something outside, the call leaves the sandbox and goes to a gateway we run. The gateway decides whether the call is allowed, attaches the right credential, forwards it, and passes the response back. The agent sees results. It never sees the secret that produced them.

How a request reaches your tools without the agent holding a keyA Slack mention starts an agent in a fresh sandbox that holds only a signed job token. Each call goes to a gateway outside the sandbox, which verifies the token, finds the workspace from it, checks the tool is switched on, attaches the credential from an encrypted store, and forwards the call. Responses come back without the key. Database queries run read-only with a timeout and a row cap. Every action writes a receipt to the thread and an append-only log.Slack#support@Doozy why was Acmecharged twice?Answer in the threadwith a receipt for everyaction it tookSandboxfresh per task, then discardedAgentreads, plans, calls toolsWhat it holdsjob tokensigned, one job, dead after itAPI keysdatabase passwordsmodel keysThe one exceptiona token it asks for by name,with a reason. Logged.Networkcloud metadata and privateranges are unreachableGatewayoutside the sandbox1Verify the job tokensignature, and the job is live2Find the workspacefrom the token, never the request3Check the tooldestructive ones start off4Attach the credentialadded to this call, not the sandboxCredential storeencrypted per workspace5Write a receiptthread, plus an append-only logYour systemsModel providerTools and APIsStripe, GitHub, MCP…Databaseread-only transactionstatement timeoutrow capset by the gatewayjob tokenno key backanswer and receipts, to the threadHow a request reaches your tools without the agent holding a keyThe same path, top to bottom: a Slack mention, the sandbox holding only a job token, the gateway's five steps, your systems, and the answer back in the thread.Slack#support@Doozy why was Acme charged twice?Sandboxfresh per task, then discardedAgentreads, plans, calls toolsjob tokensigned, one job, dead after itAPI keysDB passwordsmodel keysThe one exceptiona token it asks for by name, with areason. Every request is logged.cloud metadata and private rangesare unreachablejob tokenno key backGatewayoutside the sandbox1Verify the job tokensignature, and the job is live2Find the workspacefrom the token, never the request3Check the tooldestructive ones start off4Attach the credentialadded to this call, not the sandboxCredential storeencrypted per workspace5Write a receiptthread, plus an append-only logkey added to this callYour systemsModel providerTools and APIsDatabaseread-only transactionstatement timeout · row capset by the gateway, not the promptSlackAnswer in the threadwith a receipt for every action it took

Every call leaves the sandbox with a job token and nothing else. The gateway turns it into a real credential for that one call, after checking the job is live, which workspace it belongs to, and that the tool is switched on.

None of this is new. A credential proxy, a service that injects keys into requests so the caller never sees them, is an old pattern, the one you'd draw on a whiteboard in five minutes. That's the point. When the thing on the other side of the boundary is a language model that will read anything it can reach, I want the boundary to be the most boring part of the system.

It matters because prompt injection isn't solved, and I don't expect it to be soon. A support ticket, a web page, a PDF someone drops in the thread: any of it can carry instructions. If one gets through, the agent can misuse the tools it has. What it can't do is print a key, write it to a file or send it somewhere, because there isn't one to find.

## Job tokens: the only credential in the sandbox

The sandbox isn't empty. It holds a job token, and every call it makes carries it. If you're thinking "so that's the credential", you're right. The design is about making it a poor one to steal.

- **It names one workspace and one job, and we sign it.** The gateway reads the workspace from the token, never from anything in the request, so no prompt, header or Slack message can point a job at another workspace's tools.
- **It dies with the job.** It expires, and on every call the gateway also checks the job is still running. Once the job finishes or someone stops it, the token is refused, even before it expires.
- **It pins the model.** The model the job started on is written into the token, and the gateway relays only to that one.

The claims are small enough to read at a glance:

```
{
  "tid": "<workspace>",
  "jid": "<job>",
  "exp": 1798387200,
  "mdl": { "p": "<provider>", "m": "<model>" }
}
```

So the worst case for a stolen token is someone making the calls this job could already make, through our gateway, for as long as the job runs. That's not nothing, and I come back to it below. It's a lot smaller than a leaked Stripe key that works from anywhere until someone notices.

## How the credential gateway checks every call

Every call goes through the same steps, in the same order.

1. **Verify the token:** the signature, the expiry, and that the job is live.
2. **Find the workspace** from the token, and only from the token.
3. **Check the tool.** Each [connected tool](https://askdoozy.com/integrations) is switched on or off per workspace. Anything that deletes, sends, refunds, publishes or changes who can see something starts switched off, and an owner turns those on one at a time. We don't rely on a service's own labels for this, because some don't mark sending an email as risky. Our own rule runs on top.
4. **Attach the credential.** Credentials are stored encrypted per workspace. The one a call needs is added to that request on our side of the boundary, never to the sandbox.
5. **Write a receipt.** Every action shows up in the [Slack thread](https://askdoozy.com/integrations/slack) and goes into an audit log nobody can edit, including us.

The sandbox's network is fenced too. The cloud metadata endpoint and private address ranges are unreachable from inside it, so the agent can't wander from its VM into the machines around it.

## Read-only SQL for AI agents, enforced outside the prompt

The database connector is where people expect the scariest stories, so it gets the strictest rules, and none of them depend on the prompt. The model writes a query. Before it runs, the gateway wraps it:

```
begin read only;
set local statement_timeout = 30000;

select * from (
  -- the query the model wrote
) as doozy_query limit 201;

rollback;
```

Three things fall out of that wrapper.

- **Only one statement can run.** A second statement, a stray `COMMIT` trying to leave the read-only transaction, or a write all become a syntax error inside the subquery before anything executes. Anything that doesn't start as `SELECT`, `WITH`, `TABLE` or `VALUES` is refused with a plain message, so the model can fix its query instead of guessing at a parse error.
- **Postgres refuses writes anyway.** If something slipped past the wrapper, the transaction is read-only and always rolled back.
- **It can't run forever or return everything.** Statements time out, 30 seconds by default, and results stop at 200 rows. The 201st row only tells the model there's more, so it learns to aggregate instead of paging through a table.

Read-only is not the same as safe. The agent can read whatever its database user can read, and it can post that in Slack. The right setup is a user scoped to the tables it needs, on a replica if you have one, and every query it ran is in the thread for anyone to check.

## When an agent needs a secret inside the sandbox

Some work genuinely needs a secret inside the sandbox: a CLI that only takes a token, an SSH key for a deploy. Saying no to all of it would make a lot of real tasks impossible.

So there's one door. The agent asks for a secret by name and says why. The request is logged with its reason, and only then is the value handed in.

This is the part I'm least comfortable with. Once a value is inside, a prompt injection can ask for it too. The log tells you exactly what was asked for and why. It doesn't tell you what happened to the value afterwards. I've accepted that trade because the alternative was a product that can't do half of what teams ask, but if you see a better design, I'd like to hear it.

## What prompt injection can still do without keys

Taking the keys away removes one failure: losing a credential. It doesn't touch the ones that matter more. Here's what an attacker gets if a prompt injection takes over a job.

If a prompt injection takes over a job

It can

- Use the tools that are switched on, as this workspace.
- Read whatever those tools and that database user can read.
- Send what it read to a public URL. The sandbox can reach the web, because looking things up is part of most tasks.
- Use the job token from outside, through our gateway, until the job ends.

It can't

- See, copy or keep a key for your systems.
- Delete, send, refund or publish with a tool no owner turned on.
- Point the job at another workspace's tools.
- Write to the database, or hold it with a long query.
- Reach the cloud metadata endpoint or our private network.
- Use the token once the job is over.

So the controls that matter sit on the far side of the gateway: which tools are on, what each one can read, and receipts that put every action in front of the people in the thread. Our [security page](https://askdoozy.com/security) lists them, and [AI and data use](https://askdoozy.com/data-use) covers what the model sees and keeps. A thread turns out to be a good audit surface. People notice when their coworker does something odd in front of them.

The question I keep going back and forth on is whether a person should approve an action before it happens. Today the answer is tools that start off, plus a receipt for everything. Approval on every step turns a coworker back into a form to fill in. Approval on nothing is how you end up in an incident review. I suspect the answer is per tool, but I'd rather hear from people running agents against production than guess.

##
shivsarthak10
🟧 echo.blog ⭐Doozy's account describes fresh per-task sandboxes holding signed job tokens rather than API keys; an external gateway checks authorization Shiv Sarthak Sabhlok——

Interpretation history

Decision trace