OpenAI Integration

Guard OpenAI Function Calls Before They Run

Add approval gates and blocking to GPT-4 function calls before they execute. No more silent tool execution.

GPT-4 function calls execute silently

No native way to pause, block, or require human review. When GPT-4 decides to call a function, it happens automatically. You only find out after the fact — after the email is sent, the record is deleted, or the API is called.

Without Runplane
Agent decidesTool executesNo control

Intercept function calls before execution

Receive the function_call from OpenAI, pass it through Runplane for policy evaluation, then execute only if approved. Full control over every GPT function call.

agent.ts
import { Shield } from "@runplane/runplane-sdk";

const runplane = new Shield({
  apiKey: process.env.RUNPLANE_API_KEY
});

// After receiving function_call from OpenAI, before executing
const message = response.choices[0].message;

if (message.function_call) {
  const result = await runplane.guard(
    message.function_call.name,
    "openai-agent",
    JSON.parse(message.function_call.arguments),
    async () => executeFunctionCall(message.function_call)
  );

  if (result.decision === "BLOCKED") {
    // Handle blocked action
    return { error: "Function call blocked by policy" };
  }
}

What You Get

Block dangerous function calls

Require human approval for sensitive operations

Full audit trail of GPT actions

How Runplane Works

1

Intercept

guard() intercepts the action before execution

2

Decide

Policy engine evaluates and returns a decision

3

Execute or Halt

Action runs, blocks, or waits for approval

ALLOW
REQUIRE_APPROVAL
BLOCK

Control Any Function Call

send_email()
delete_record()
create_user()
transfer_funds()

Start free at runplane.ai

Add runtime control to your OpenAI agents in minutes. No credit card required.