Connect Agents and Clients

Wire IDE, hooks, MCP, and SDK surfaces into published runtime policy, workflows, and governed act runs.

Runtime policyWorkflowsOSS examples

Connect is how agent and IDE surfaces inherit governed act. Your stack still owns infer and decide. Blekline applies published runtime policy at the boundary (hooks, MCP, SDK, or cluster sidecar), then records act as workflow runs when side effects matter.

Publish runtime policy

Clients and hooks read the workspace compileHash from published policy. Publish from Runtime policy before you treat Connect as production-ready. Staging and review live on the same page.

Policy first

Enforcement in the IDE is not a separate rule set. It uses the same compiled guards as runs and cells.

Control plane

  • Runtime policyAuthor protections, publish, and note compileHash on the publish card.
  • Runtime enforcementObserve vs enforce staging for MCP and SDK surfaces in the app.

Choose a surface

Execution surfaces

Pick where the agent runs relative to Blekline. All paths use the same policy decision order.

Where enforcement runs

  • LocalIDE hooks (Cursor, Codex) on chat ingress and shell guard. Same compileHash as published runtime policy.
  • Platform TeamHosted MCP, ingress, and SDK on Blekline runtime. blekline-proxy for downstream tool lists.
  • SDKmask, enforceToolCall, and createCellRun in your service. Use runs:write when you record act against a workflow.
  • Productioncells in your VPC: sidecar on connected Kubernetes, cell profiles, optional clusterId on cell-runs.
  • EnterpriseStronger isolation paths on connected clusters (admission, mandatory hop) where your contract includes them.
npm install @blekline/client

import { BleklineClient } from "@blekline/client";

const client = new BleklineClient({
  workspaceToken: process.env.BLEKLINE_WORKSPACE_TOKEN!,
  metadata: { clientSurface: "sdk" },
});

const policy = await client.getExecutionPolicy();
// publish compileHash in console before relying on this in production

const decision = await client.enforceToolCall({
  toolName: "run_sql",
  arguments: { query: userQuery },
  platform: "langchain",
  clientSurface: "sdk",
});
if (decision.action === "block") throw new Error("Blocked by policy");

await client.createCellRun({
  workflowId: "wf_your_path",
  executionTier: "act",
  toolCall: true,
});

Wire IDE or agent clients

Clients

Configure the client once policy is published. Hooks cover native chat where MCP cannot see prompts.

Primary IDE and agent clients

  • CursorHooks for native chat plus MCP and proxy. Start here for Local surface governance.
  • Claude CodeProject MCP and proxy. Tie side-effect tools to workflow runs when you automate act.
  • VS Code / GitHub CopilotWorkspace MCP. Policy applies at tool-call time through the same enforce path.

More clients

  • CodexHooks package plus MCP configs from generate:mcp-configs.
  • ContinueMCP JSON with mask:write on the workspace token.
  • Claude DesktopConnector or MCP; token header on every tool call.

Frameworks and services

Application and framework code

Official packages wrap mask and enforce. Call createCellRun when a node performs side effects.

Framework tool use

Direct model SDKs

  • OpenAI / Anthropic / othersMask with @blekline/client before the chat API; enforceToolCall on custom tools.
  • Vercel AI SDKCall enforce in tool execute; OSS pattern under frameworks/vercel-ai-tool-guard.
  • Act at framework boundarycreateCellRun with executionTier act, toolCall true, and runs:write when effects happen.
npm install @blekline/client @blekline/langchain

import { BleklineClient } from "@blekline/client";
import { maskPromptForChain, enforceToolCallForChain } from "@blekline/langchain";

const client = new BleklineClient({
  workspaceToken: process.env.BLEKLINE_WORKSPACE_TOKEN!,
  metadata: { clientSurface: "sdk" },
});

const masked = await maskPromptForChain(client, userPrompt, "langchain");

const decision = await enforceToolCallForChain(client, "search_docs", { query: masked.maskedText });
if (decision.action === "block") throw new Error("Tool call blocked by policy");

Attach act to workflows and cells

Execution plane

Chat-only masking does not require a workflow. Governed act with audit and placement does.

Execution plane wiring

  • WorkflowStable wf_ id for repeat act paths. Required when you createCellRun or use console Runs.
  • Runtime policyPublish before production traffic. Runs inherit compileHash at birth.
  • Runs and auditConfirm governed act in Runs and metadata in Audit log, not only IDE smoke tests.
  • Endpoints and keysRegister connector surfaces and scoped workspace tokens (mask, events, runs).

Build artifacts (workspace)

  • Protections and guardsAuthor guard sets under Runtime policy. Staging and review before publish.
  • Capability packsBind MCP tools and guard sets for repeatable agent tool allowlists in the app.
  • Fleet skillsPublished skill bodies your workspace attaches to governed tool surfaces.

Fast act on Blekline runtime (Platform Team). Isolated act uses Spin up cells with profiles and optional clusterId on POST /api/workspace/cell-runs.

Verify enforcement

Production verify: start or trigger an act run, open Runs, and confirm the run row shows the same compileHash as Runtime policy. Check Audit log for metadata events (no raw prompt storage by default).

Local smoke: use Cursor hooks with a fake key or call dev MCP tools below. Activity alone is not sufficient for act governance sign-off.

Dev MCP tools (optional)

Workspace token required. Prefer Runtime policy review and enforcement playground for staging simulations.

  • blekline_mask_promptMask PII and secrets (dev smoke).
  • blekline_evaluate_tool_callPreview allow, mask, or block for a tool.
  • blekline_simulate_policyRead-only simulation; prefer Runtime policy review for staging.
  • blekline_log_governance_eventMetadata-only audit event from the client.