What is Brane?
Brane is a policy-as-code runtime control layer for AI agents. It lets teams write Python policies that allow, deny, or eventually transform agent actions before they execute.
Brane · private beta
Brane is policy-as-code for AI agents. Write Python policies that run before tool calls, model calls, MCP tools, database queries, memory writes, retrieval, and other agent actions execute.
Brane is a policy-as-code runtime control layer for AI agents. It lets teams write Python policies that allow, deny, or eventually transform agent actions before they execute.
Yes. Brane acts as runtime guardrails for AI agents by governing tool calls, model calls, database queries, MCP tools, memory writes, retrieval, and other capabilities at the action boundary.
Prompt guardrails influence model behavior. Brane enforces policy when an agent attempts an action, so unsafe tool calls or database queries can be blocked before side effects occur.
Brane is framework-independent at the core runtime layer. Dedicated adapters for LangGraph, CrewAI, OpenAI Agents SDK, and MCP are planned, and teams can wrap capability boundaries directly today.
01 WRITE
Decorate a Python function with @brane.policy. It receives a context object — the capability being requested, the session state, anything you need to make a decision.
02 ENFORCE
Before any wrapped capability executes, your policy function runs synchronously. Return Decision.allow(), block(), or rewrite() — Brane does the rest.
03 TRACE
Every enforced action leaves a structured log: what capability was requested, which policy ran, what was decided, why. Auditable, exportable, replayable.
from brane import Decision, Runtime
runtime = Runtime()
@runtime.before_capability("tool.delete_user")
def require_approval(ctx):
if not ctx.session.has_human_approval:
return Decision.block(
reason="requires explicit approval"
)
return Decision.allow()"My agent has access to delete_user. What stops it from calling that on the wrong user?"
Every destructive tool call now requires an upstream signal. Traced, auditable, reversible.
See full example →@brane.policy("tool.delete_user")
def require_human_confirmation(ctx):
if not ctx.session.has_human_approval:
return Decision.block(
reason="delete_user requires explicit human approval"
)
return Decision.allow()"My agent burned $400 last week calling GPT-5 on tasks GPT-5-mini could handle."
@brane.policy("model.call")
def route_cheap_when_simple(ctx):
if ctx.prompt_tokens < 200 and ctx.task_type == "classify":
return Decision.rewrite(model="gpt-5-mini")
return Decision.allow()Routing decisions become a function, not a hard-coded branch. Hot-reloadable. No redeploy.
See full example →"My agent saw a customer's SSN in context. What's stopping it from echoing it to a third-party tool?"
@brane.policy("tool.email.send")
def redact_pii(ctx):
if contains_pii(ctx.payload.body):
ctx.payload.body = redact(ctx.payload.body)
return Decision.rewrite(payload=ctx.payload)
return Decision.allow()PII never leaves the agent. The redaction is logged in the trace, not the email.
See full example →In the first two weeks of private beta, we wrap your capabilities, write the first policy functions, and produce a full decision trace — showing exactly what your agent is allowed to do and what gets blocked.