Secure agent tool calls at ingress

June 8, 2026

Single prompts were already hard to govern. Agents made it structural.

‍

An agent does not ask one question and wait. It reads files, calls shell commands, hits internal APIs, and loops until the task is done. Each step is a tools/call. Each call is a potential data leak, a policy violation, or an execution you cannot explain to an auditor.

‍

The failure mode is predictable: Cursor is asked to fix a CI pipeline. The agent finds credentials in the repo, passes them into model context, then calls a deployment tool with arguments nobody reviewed. The UI shows success. Security finds out later — if at all.

‍

Agents changed the threat model

‍

Three properties break chat-only assumptions:

‍

  • Volume — one user request can trigger dozens of tool calls in minutes. Manual review does not scale.  
  • Opacity — tool arguments often contain secrets, file paths, and customer IDs that never appear in the chat bubble.  
  • Composition — read → reason → execute. A secret picked up in step two leaves through a different tool in step four.

‍

Prompt instructions like “never include secrets” degrade as context grows, models change, or agents chain calls. You need deterministic enforcement where calls are made — at the MCP, SDK, or sidecar boundary — not hope in the system prompt.

‍

The ungoverned gap

‍

Many teams ship agents before they ship governance.

‍

Agent (L5) → Model API / tools ← no policy hop
Agent (L5) → Blekline (L4) → Model / MCP tools

‍

The agent keeps working. Governance becomes infrastructure — same pattern as adding an API gateway, except the unit of control is tool calls and session state, not HTTP routes alone.

‍

Ingress, not output filtering

‍

Post-model guardrails validate outputs. Useful for format and toxicity. They cannot undo a shell command that already ran, or un-send an API key that already entered model context. Ingress enforcement evaluates what is about to happen. For agents, that means governing tools/call at the MCP boundary — before run_shell, write_file, or query_database executes.

‍

Blekline also governs model API egress on the sidecar path (redact responses on the way back). Ingress and egress are one enforcement plane, not two products.

‍

What runs at the boundary

‍

Open-core MCP and enterprise sidecar share the same policy model:

‍

  • Mask prompts — blekline_mask_prompt redacts PII, payment patterns, and secrets before text reaches a model. Audit records entity counts and actions, not raw bodies by default.  
  • Evaluate tool calls — blekline_evaluate_tool_call checks tool name and arguments against workspace policy. Returns allow, mask, or block before the downstream tool runs.  
  • Lineage block — destructive tools blocked when session lineage is contaminated (Trust Vault + Lineage Firewall on the sidecar path).  
  • Emit audit events — metadata per decision: action, risk tier, tool name, client surface, correlation ID.

‍

Deployment surfaces (pick your track)

‍

Same policy, same evidence — different insertion points.

‍

Track Surface Typical buyer
03 — MCP eval@blekline/mcp-server in Cursor, Claude Desktop, ContinueEngineering + security champion
02 — Docker sidecarghcr.io/blekline/sidecar inline with agent runtimePlatform team eval
01 — K8s fleetHelm + mutating webhook auto-injectRegulated production
Proxy@blekline/mcp-proxy in front of existing MCP serversSandbox + internal APIs without rewriting servers

‍

REST ingress (/api/mask, /api/mcp/enforce-tool-call) covers custom SDK agents. Kong at L3 can sit in front of routes; Blekline still owns what the agent session may do at L4.

‍

Proof, not promises

‍

Public benchmark suite B1–B8 (August 2026 run) exercises mask latency, tool enforce, lineage block, and audit metadata across vendor-neutral scenarios. See https://blekline.com/benchmarks for methodology and latest results. Blekline passes all eight; use the grid to compare against your current stack’s coverage gaps — not as a vendor bake-off score.

‍

EU AI Act hook (engineering, not legal advice)

‍

Article 14 human oversight does not mean a human watches every agent call. It means your system must support intervention — tool calls that can be blocked or masked with records of what policy decided. Articles 12 and 17 expect logging of system behaviour. Ingress enforcement is the intervention mechanism; the metadata activity stream is the record.

‍

Whether your deployment is high-risk, and what conformity documentation you need, still requires legal analysis. Blekline supplies the technical control layer; your DPO maps it to obligations.

‍

Rollout sequence

‍

  1. Connect one MCP client (Cursor is the common starting point) — https://app.blekline.com/docs/get-started/mcp-eval
  2. Configure tool policy: block shell and arbitrary network first; allow read-only tools
  3. Enable mask on prompt ingress for secrets and regulated identifiers
  4. Review Activity for one week; tune false positives before tightening
  5. Add MCP proxy in front of sandbox or internal tool servers as capability grows
  6. For fleet: nhim-audit → sidecar Helm → policy SSE from control plane

‍

Governance should feel like adding a load balancer, not rewriting your agents.

‍

MCP eval quickstart — https://app.blekline.com/docs/get-started/mcp-eval  

MCP proxy — https://app.blekline.com/docs/mcp/proxy  

MCP server reference — https://app.blekline.com/docs/mcp/server  

Ingress proxy API — https://app.blekline.com/docs/api/ingress-proxy