SecretStore.create(opts)123456import { SecretStore } from '@opencomputer/sdk'; const store = await SecretStore.create({ name: 'my-agent-secrets', egressAllowlist: ['api.anthropic.com'], });
body namestringrequiredbody egressAllowliststring[]["api.anthropic.com"])Promise<SecretStoreInfo>SecretStore.list(opts?)Promise<SecretStoreInfo[]>SecretStore.get(storeId, opts?)body storeIdstringrequiredPromise<SecretStoreInfo>SecretStore.update(storeId, opts)1234const updated = await SecretStore.update('store-uuid', { name: 'new-name', egressAllowlist: ['api.anthropic.com', '*.openai.com'], });
body storeIdstringrequiredbody namestringbody egressAllowliststring[]Promise<SecretStoreInfo>SecretStore.delete(storeId, opts?)Promise<void>SecretStore.setSecret(storeId, name, value, opts?)1await SecretStore.setSecret('store-uuid', 'ANTHROPIC_API_KEY', 'sk-ant-...');
123await SecretStore.setSecret('store-uuid', 'ANTHROPIC_API_KEY', 'sk-ant-...', { allowedHosts: ['api.anthropic.com'], });
body storeIdstringrequiredbody namestringrequiredbody valuestringrequiredbody allowedHostsstring[]Promise<void>SecretStore.listSecrets(storeId, opts?)Promise<SecretEntryInfo[]>SecretStore.deleteSecret(storeId, name, opts?)Promise<void>secretStore option to Sandbox.create() to inject the store's secrets:12345678910111213const sandbox = await Sandbox.create({ secretStore: 'my-agent-secrets', timeout: 600, }); // Secrets are available as sealed env vars const result = await sandbox.commands.run('echo $ANTHROPIC_API_KEY'); // stdout: "osb_sealed_abc123..." (sealed, not the real key) // But outbound HTTPS requests get the real value substituted by the proxy const apiResult = await sandbox.commands.run( 'curl -s https://api.anthropic.com/v1/messages -H "x-api-key: $ANTHROPIC_API_KEY" ...' );
123456789101112131415161718import { Sandbox, Snapshots, Image } from '@opencomputer/sdk/node'; // Pre-build a snapshot with dependencies const snapshots = new Snapshots(); await snapshots.create({ name: 'data-pipeline', image: Image.base().aptInstall(['python3-pip']).pipInstall(['pandas']), }); // Create sandboxes from the snapshot, each with their own credentials const worker1 = await Sandbox.create({ snapshot: 'data-pipeline', secretStore: 'worker-1-keys', }); const worker2 = await Sandbox.create({ snapshot: 'data-pipeline', secretStore: 'worker-2-keys', });
123456789// Bake a base environment with git credentials const base = await Sandbox.create({ secretStore: 'git-creds' }); await base.exec.run('git clone https://github.com/org/repo /app', { cwd: '/' }); const cp = await base.createCheckpoint('repo-cloned'); // Fork with different credentials per sandbox (layered on top of git-creds) const worker = await Sandbox.createFromCheckpoint(cp.id, { secretStore: 'worker-keys', // layered on top of git-creds });
| Property | Type | Description |
id | string | Store UUID |
orgId | string | Organization UUID |
name | string | Store name |
egressAllowlist | string[] | Allowed egress hosts |
createdAt | string | ISO 8601 timestamp |
updatedAt | string | ISO 8601 timestamp |
| Property | Type | Description |
id | string | Entry UUID |
storeId | string | Parent store UUID |
name | string | Secret name (env var name) |
allowedHosts | string[] | Host restrictions |
createdAt | string | ISO 8601 timestamp |
updatedAt | string | ISO 8601 timestamp |