Runtime Execution Control

The execution boundary for AI systems

Runplane sits in the execution path between AI agents and production systems. The Guard API enforces policy decisions before actions run.

Agent
guard()
Guard API

ALLOW

Executes

REQUIRE_APPROVAL

Waits for human

BLOCK

Prevented

Runplane is an execution control layer, not an agent framework.

This is runtime enforcement—not observability, not orchestration.

How Runplane Works

Every action flows through the Guard API before execution

1

Agent calls guard()

Action type, target, and context are sent to Runplane

2

Request goes to Guard API

The Gateway receives the request at /api/v1/guard

3

Guard API returns decision

Policy is evaluated and a decision is returned: ALLOW, BLOCK, or REQUIRE_APPROVAL

4

Execution is allowed or blocked

The SDK enforces the decision locally. Callback only runs if ALLOW.

System Flow

End-to-end execution control

1. Tools / Actions Defined

Import from LangChain, OpenAPI, Vercel AI SDK, or define manually.

2. Action Mapping (Canonical Types)

Tools are mapped to canonical action types: delete, deploy, send_email, payment, etc.

3. Policy + Context

Policies evaluate action type, target, environment, and full context.

4. Guard API Call

Action + context sent to /api/v1/guard

5. Decision Returned

Guard API returns ALLOW, BLOCK, or REQUIRE_APPROVAL.

6. Execution Controlled

SDK enforces the decision. Callback runs only if ALLOW.

7. Audit Recorded

Every action and decision is recorded in the audit log.

Decision Model

Three possible outcomes for every action

ALLOW

Callback executes immediately

BLOCK

Callback never runs, throws ShieldError

REQUIRE_APPROVAL

Execution pauses until human decision

Core Primitive

Guard API

The enforcement boundary. All decisions are made server-side.

POST https://runplane.ai/api/v1/guard
  • Receives action + context
  • Evaluates policy rules
  • Returns decision (ALLOW, BLOCK, REQUIRE_APPROVAL)

Gateway Mode = Enforcement Boundary: All decisions are made server-side via the Guard API (/api/v1/guard). The SDK is an optional wrapper for convenience—the enforcement happens in the Gateway.

SDK Mode (Optional)

SDK Integration

The SDK wraps the Guard API for convenience. Gateway Mode handles the enforcement—SDK Mode is optional.

TypeScript
import { Shield } from "@runplane/runplane-sdk"

const shield = new Shield({
  baseUrl: "https://runplane.ai",
  apiKey: process.env.RUNPLANE_API_KEY,
  failMode: "closed"
})

await shield.guard(
  "delete_record",
  "users-database",
  { recordId: "user_123" },
  async () => {
    await deleteUser("user_123")
  }
)
Human-in-the-Loop

Human Approval Flow

REQUIRE_APPROVAL pauses execution until a human decides

1

guard() returns

REQUIRE_APPROVAL

2

Request appears

Dashboard → Approvals

3

Human reviews

Context displayed

Approve

Callback executes

Deny

Throws ShieldError

The SDK does not provide approval UI. It only waits for the decision. Approvals are handled in the Runplane Dashboard.

Compliance Ready

Audit & Compliance

Every action and decision is recorded in the audit log

Captured in Every Event

action
context
decision
timestamp
Audit Event
{
  "eventId": "evt_8a3k2m",
  "timestamp": "2024-12-15T14:32:01Z",
  "action": "delete_record",
  "target": "users-database",
  "decision": "REQUIRE_APPROVAL",
  "context": {
    "recordId": "user_123"
  }
}

Failure Modes

Fail-closed by default for safety

failMode: "closed"(default)
  • Invalid API key → BLOCK
  • Network failure → BLOCK
  • Timeout → BLOCK

This is a safety guarantee. If Runplane cannot be reached, execution is blocked.

failMode: "open" is available for testing, where actions proceed without enforcement if Runplane is unreachable.

Runtime Enforcement Platform

Runplane sits between AI agents and real-world systems. The Guard API enforces policies at runtime, returning deterministic decisions that control whether actions are allowed to execute.

Gateway-FirstFail-ClosedHuman ApprovalFull Auditability

Start Controlling AI Execution

Integrate in minutes. Enforce policies at runtime. Full decision trace from day one.