Agent Context

View as Markdown

Agent Context gives an AI coding agent the current shape of a space: relevant runtimes, available operations, safety rules, examples, limits, and links back to the API reference.

Use it when an agent is writing scripts, repairing workflows, or choosing how to interact with BCTRL through the SDK or HTTP API.

Fetch context

1const context = await space.agentContext({
2 runtimeId: runtime.id,
3 detail: "compact",
4});
5
6for (const operation of context.operations) {
7 console.log(operation.id, operation.path);
8}

Request full examples when an agent needs copyable shapes:

1const context = await space.agentContext({
2 runtimeId: runtime.id,
3 detail: "full",
4 include: ["examples"],
5});

What it contains

FieldPurpose
spaceThe current space boundary.
runtimeThe selected runtime, when one is provided or inferable.
operationsValid operations relevant to the runtime, topic, and status.
rulesShort constraints agents should follow.
examplesCompact examples an agent can adapt.
limitsRelevant account, space, or runtime limits.
linksOpenAPI, docs, and llms.txt entrypoints.

How agents should use it

Agent Context is not a chat prompt. It is structured API guidance. Agents should read it before deciding whether to create a connection, inspect a run, download an artifact, or ask for more runtime state.