Skip to main content

OpenBox on CopilotKit

OpenBox sits on top of CopilotKit. CopilotKit can connect to multiple backend agent frameworks. This guide documents the LangGraph backend path.

The integration governs CopilotKit runtime prompts, tool input, tool output, assistant output, and approval decisions while preserving the CopilotKit UI and the LangGraph agent shape behind it.

Package exports:

  • openbox-sdk/copilotkit
  • openbox-sdk/copilotkit/react
GuideDescription
Run the DemoClone and run the OpenBox-on-CopilotKit reference app with LangGraph
Add OpenBox to CopilotKitAdd OpenBox above CopilotKit in an app where CopilotKit uses LangGraph as the backend
ConfigurationEnvironment variables, adapter options, and runtime behavior
Integration WalkthroughEnd-to-end guide for wiring the runtime, LangGraph middleware, governed tools, and React renderers
What The Integration Does

The integration connects the CopilotKit runtime to OpenBox, then uses the current LangGraph bridge to instrument the backend agent process. Trust policy, approvals, guardrails, dashboards, and operator workflows live on the OpenBox platform, not inside CopilotKit.

Required OpenBox Setup

Before wiring the CopilotKit runtime, register an OpenBox agent, generate its runtime key, and configure its trust controls in Authorize. CopilotKit sends events to the registered agent; OpenBox evaluates the agent's guardrails, policies, and behavior rules.

Use OpenBox above CopilotKit, and use the current LangGraph bridge for backend instrumentation:

LayerOpenBox hookPurpose
OpenBox on CopilotKit runtime routecreateOpenBoxCopilotRuntime()governs prompt ingress and assistant output around /api/copilotkit
OpenBox CopilotKit adaptercreateOpenBoxCopilotKitAdapter()configures Core credentials, gate behavior, session state, and tool names
CopilotKit on LangGraph middlewareadapter.createLangChainMiddleware()governs LangGraph model/tool activity inside the agent process
Business toolscreateGovernedCopilotTool()returns OpenBox decisions and releasable artifacts through the same tool result
Approval routecreateOpenBoxApprovalRoute()submits human approval decisions back to OpenBox
React UIuseOpenBoxCopilotKit()renders OpenBox decision, interactive review, approval, and action-result components

Public API Summary

Server-side exports:

  • createOpenBoxCopilotKitAdapter()
  • createOpenBoxCopilotRuntime()
  • createOpenBoxGovernedRunner()
  • createOpenBoxRuntimeHooks()
  • createGovernedCopilotTool()
  • createOpenBoxApprovalRoute()
  • createOpenBoxReadinessCheck()
  • OPENBOX_COPILOTKIT_RESULT_SCHEMA_VERSION

React exports:

  • useOpenBoxCopilotKit()
  • createOpenBoxApprovalClient()
  • createOpenBoxCustomMessageRenderer()
  • OpenBoxGovernanceDecision
  • OpenBoxApprovalReview
  • OpenBoxInteractiveReview
  • OpenBoxActionResult

Governance Boundaries

OpenBox can evaluate these CopilotKit gates:

GateWhat is evaluated
promptuser prompt and recent runtime messages before agent execution
tool_inputnormalized tool arguments before business execution
tool_outputraw tool result before rendering
assistant_outputfinal assistant content before it reaches the user

Governed tool results use schema version openbox.copilotkit.result.v1.

Supported Runtime Conditions

RequirementValue
Node.js>=22 for the reference app
CopilotKit@copilotkit/react-core and @copilotkit/runtime ^1.59 in the reference app
LangGraph JS@langchain/langgraph ^1.3 in the reference app
OpenBox SDKopenbox-sdk with copilotkit and copilotkit/react exports
CopilotKit runtimeNext.js App Router route backed by /api/copilotkit

Next Steps

  1. Run the OpenBox-on-CopilotKit demo.
  2. Add the integration to an existing app with Add OpenBox to CopilotKit.
  3. Configure OpenBox trust controls in Authorize.
  4. Configure production behavior in Configuration.