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.
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_promptredacts 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_callchecks 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.
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
- Connect one MCP client (Cursor is the common starting point) —
https://app.blekline.com/docs/get-started/mcp-eval - Configure tool policy: block shell and arbitrary network first; allow read-only tools
- Enable mask on prompt ingress for secrets and regulated identifiers
- Review Activity for one week; tune false positives before tightening
- Add MCP proxy in front of sandbox or internal tool servers as capability grows
- 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


