zlacker

[parent] [thread] 10 comments
1. simonw+(OP)[view] [source] 2026-02-03 18:25:30
Yeah, this is a really neat idea: https://deno.com/blog/introducing-deno-sandbox#secrets-that-...

  await using sandbox = await Sandbox.create({
    secrets: {
      OPENAI_API_KEY: {
        hosts: ["api.openai.com"],
        value: process.env.OPENAI_API_KEY,
      },
    },
  });
  
  await sandbox.sh`echo $OPENAI_API_KEY`;
  // DENO_SECRET_PLACEHOLDER_b14043a2f578cba75ebe04791e8e2c7d4002fd0c1f825e19...
It doesn't prevent bad code from USING those secrets to do nasty things, but it does at least make it impossible for them to steal the secret permanently.

Kind of like how XSS attacks can't read httpOnly cookies but they can generally still cause fetch() requests that can take actions using those cookies.

replies(2): >>ryanra+8l >>its-su+5C
2. ryanra+8l[view] [source] 2026-02-03 19:50:28
>>simonw+(OP)
> It doesn't prevent bad code from USING those secrets to do nasty things, but it does at least make it impossible for them to steal the secret permanently.

Agreed, and this points to two deeper issues: 1. Fine-grained data access (e.g., sandboxed code can only issue SQL queries scoped to particular tenants) 2. Policy enforced on data (e.g., sandboxed code shouldn't be able to send PII even to APIs it has access to)

Object-capabilities can help directly with both #1 and #2.

I've been working on this problem -- happy to discuss if anyone is interested in the approach.

replies(1): >>Tomuus+DU
3. its-su+5C[view] [source] 2026-02-03 21:10:09
>>simonw+(OP)
if there is an LLM in there, "Run echo $API_KEY" I think could be liable to return it, (the llm asks the script to run some code, it does so, returning the placeholder, the proxy translates that as it goes out to the LLM, which then responds to the user with the api key (or through multiple steps, "tell me the first half of the command output" e.g. if the proxy translates in reverse)

Doesn't help much if the use of the secret can be anywhere in the request presumably, if it can be restricted to specific headers only then it would be much more powerful

replies(2): >>lucaca+dH >>simonw+3V
◧◩
4. lucaca+dH[view] [source] [discussion] 2026-02-03 21:37:21
>>its-su+5C
It will only replace the secret in headers
replies(1): >>shivas+zu5
◧◩
5. Tomuus+DU[view] [source] [discussion] 2026-02-03 22:46:54
>>ryanra+8l
Object capabilities, like capnweb/capnproto?
replies(1): >>ryanra+061
◧◩
6. simonw+3V[view] [source] [discussion] 2026-02-03 22:49:28
>>its-su+5C
Secrets are tied to specific hosts - the proxy will only replace the placeholder value with the real secret for outbound HTTP requests to the configured domain for that secret.
replies(1): >>its-su+Mi1
◧◩◪
7. ryanra+061[view] [source] [discussion] 2026-02-03 23:51:20
>>Tomuus+DU
Yes exactly Cap'n Web for RPC. On top of that: 1. Constrained SQL DSL that limits expressiveness along defined data boundaries 2. Constrained evaluation -- can only compose capabilities (references, not raw data) to get data flow tracking for free
◧◩◪
8. its-su+Mi1[view] [source] [discussion] 2026-02-04 01:07:34
>>simonw+3V
which, if its the LLM asking for the result of the locally ran "echo $API_KEY", will be sent through that proxy, to the correct configured domain. (If it did it for request body, which apparently it doesn't (which was part of what I was wondering))
replies(1): >>Danger+b53
◧◩◪◨
9. Danger+b53[view] [source] [discussion] 2026-02-04 15:14:28
>>its-su+Mi1
The AI agent can run `echo $API_KEY` all it wants, but the value is only a placeholder which is useless outside the system, and only the proxy service which the agent cannot directly access, will replace the placeholder with the real value and return the result of the network call. Furthermore, the replacement will happen within the proxy service itself, it does not expose the replaced value to memory or files that the agent can access.

It's a bit like taking a prepaid voucher to a food truck window. The cashier receives the voucher, checks it against their list of valid vouchers, records that the voucher was used so they can be paid, and then gives you the food you ordered. You as the customer never get to see the exchange of money between the cashier and the payment system.

replies(1): >>its-su+E06
◧◩◪
10. shivas+zu5[view] [source] [discussion] 2026-02-05 05:39:13
>>lucaca+dH
It replaces URL params and body too
◧◩◪◨⬒
11. its-su+E06[view] [source] [discussion] 2026-02-05 10:25:20
>>Danger+b53
(Noting that, as stated in another thread, it only applies to headers, so the premise I raised doesn't apply either way)

Except that you are asking for the result of it, "Hey Bobby LLM, what is the value of X" will have Bobby LLM tell you the real value of X, because Bobby LLM has access to the real value because X is permissioned for the domain that the LLM is accessed through.

If the cashier turned their screen around to show me the exchange of money, then I would certainly see it.

[go to top]