Sandbox metadata
Metadata associates a sandbox with application data such as a session, user, job, or environment. Keys and values are strings and are returned by list and info operations.
mjs
import { Sandbox } from "@abox-dev/sdk";
const sandbox = await Sandbox.create({
metadata: { sessionId: "session-42", environment: "development" },
});
try {
const paginator = Sandbox.list({
query: { metadata: { sessionId: "session-42" } },
});
const sandboxes = await paginator.nextItems();
console.log(sandboxes[0].metadata);
} finally {
await sandbox.kill();
}py
from agentbox import Sandbox, SandboxQuery
sandbox = Sandbox.create(
metadata={"sessionId": "session-42", "environment": "development"}
)
try:
paginator = Sandbox.list(
query=SandboxQuery(metadata={"sessionId": "session-42"})
)
sandboxes = paginator.next_items()
print(sandboxes[0].metadata)
finally:
sandbox.kill()Filtering happens on the AgentBox API, so your application does not need to download every sandbox first. Multiple metadata pairs select sandboxes that match all pairs.
Metadata is visible to project members and API clients. Do not store API keys, passwords, or other secrets in it. Pass runtime secrets through a dedicated secret mechanism or environment variables with the access scope your application requires.