跳到正文
DEV Community· ArkNet Digital·· 1 小時前AI 評分60

AI 智能體不需要更好的提示詞,而需要控制平面

Agents Don't Need Better Prompts. They Need a Control Plane.

AI 導讀

生產環境中的 AI 智能體安全應由模型外的控制平面約束,而非只依賴系統提示詞。框架包括身份、權限、操作中介、不可篡改的證據記錄及緊急撤銷,並提出透過閘道政策限制工具呼叫、預算和人工審批。Wiz 報告的 Moltbook 資料外洩事故涉及約 1.5 million 個 API 驗證 tokens、逾 17,000 個帳戶持有人電郵地址,以及數千條私人智能體互傳訊息。

正文

Agents Don't Need Better Prompts. They Need a Control Plane.

Here's the uncomfortable truth about most "AI agent security" in production right now: it's a paragraph of English at the top of a system prompt asking the model to behave.

That isn't a control. It's a request.

Once software can take actions such as calling APIs, moving money, writing to databases or emailing customers, you're no longer securing a chatbot. You're securing a non-deterministic process holding real credentials, and it takes instructions from any text it reads. We already know how to govern untrusted processes with privileges. We call the answer a control plane, and agents need one.

The threat model in one sentence

Anything an agent reads can become an instruction, and anything an agent can do, an attacker can make it do.

OWASP's Top 10 for Agentic Applications (December 2025) is the best catalogue of how that plays out. It lists goal hijacking through hidden prompts (ASI01), legitimate tools bent to destructive ends (ASI02), leaked credentials letting agents operate "far beyond their intended scope" (ASI03), poisoned MCP and agent-to-agent supply chains (ASI04), memory poisoning that persists across sessions (ASI06), cascading failures through automated pipelines (ASI08), and polished explanations that talk humans into approving harmful actions (ASI09).

Read that list again and notice what's missing: none of the fixes live inside the model. Prompt injection is not a bug you patch. It's what happens when you feed instructions and data down the same channel. The only durable defense is architectural: assume the model will be compromised, and limit what a compromised model can do.

A real incident, not a hypothetical

In February 2026, Wiz reported that Moltbook, a social network for AI agents, exposed its production database through a client-side key with no row-level security behind it. The exposure included about 1.5 million API authentication tokens, more than 17,000 owner email addresses and thousands of private agent-to-agent messages, some containing third-party API keys in plaintext. Wiz said the data was secured within hours of disclosure.

The lesson isn't "configure your database." It's that agent credentials are the new crown jewels, and most stacks store them like session cookies. A stolen agent token isn't a stolen login. It's a stolen worker that already has standing permission to act.

Five planes of agent control

Here's the framework I use. A production agent system needs five things that sit outside the model, enforced by code that the model can't talk its way past.

1. Identity: every agent is a principal

An agent needs its own identity, separate from the user who launched it and from the developer who built it. The questions an auditor will ask are "which agent did this, on whose behalf, and under which grant?" If your logs say only service-account-prod, you can't answer any of them.

The 2026 MCP spec pushes hard in this direction. The 2026-07-28 release formally deprecates Dynamic Client Registration in favor of Client ID Metadata Documents, where a client's identity is an HTTPS URL it controls. It also requires that client credentials be bound to the authorization server that issued them, never reused across issuers (changelog). That's the protocol admitting that "anonymous clients registering themselves" was not a foundation you could build governance on.

2. Authority: capabilities, not roles

Roles answer "what kind of thing is this?" Agents need an answer to a different question: "what exactly may this run do, to what, for how long, and up to how much?"

That means short-lived, narrowly scoped, task-bound grants:

  • Scope: specific tools and specific resources, not *. The MCP security guidance explicitly lists wildcard scopes such as *, all and full-access as common mistakes (MCP security best practices).
  • Budget: a spend cap, a row cap and a message cap per run.
  • Time: grants expire with the task, not with the quarter.
  • Audience: tokens minted for this server. The MCP spec names token passthrough, where a server forwards a client's token to downstream APIs without checking that the token was issued to it, as an explicit anti-pattern. If a token works everywhere, a compromised agent works everywhere.

3. Mediation: every action crosses a checkpoint

The agent never touches a tool directly. Every call goes through a policy enforcement point: a gateway that authenticates the agent, evaluates the call against policy and either allows it, denies it, or holds it for a human.

The 2026 MCP spec made this architecture much cheaper to build. Streamable HTTP requests must now carry the method and tool name in Mcp-Method and Mcp-Name headers, specifically so "your gateway, rate limiter, or WAF can route and meter on those headers instead of parsing JSON bodies" (MCP blog). The protocol core also went stateless, so any request can land on any instance behind an ordinary load balancer. Put together, that makes agent traffic look like ordinary web traffic, and ordinary web traffic is something we know how to police.

A policy at that gateway can be boring, and it should be:

# agent-policy.yaml: evaluated at the gateway, never by the model
agent: support-triage@arknet-example
on_behalf_of: required          # no action without a human principal
tools:
  crm.read_ticket:
    allow: true
  crm.update_ticket:
    allow: true
    constraints:
      fields: [status, priority, internal_note]   # never customer-facing fields
  billing.issue_refund:
    allow: true
    constraints:
      max_amount_usd: 50
      max_per_run: 1
    require_approval_above_usd: 0   # every refund needs a human click
  email.send:
    allow: false                    # drafts only; humans send
budgets:
  max_tool_calls_per_run: 40
  max_wall_clock_seconds: 300
on_violation: halt_and_page

Note what this does. It doesn't ask the model to be careful about refunds. It makes an expensive refund impossible without a human, whatever the model has been convinced of.

The spec adds one more useful primitive. Multi Round-Trip Requests let a server return input_required and pause a tool call until the client supplies an answer, such as a user's confirmation. That turns human approval into a protocol feature instead of a UI hack. Supabase's team, quoted in the same release post, says it lets their tools confirm with the user "before it acts, like the cost of a new project before it's created, or a query that would delete data."

4. Evidence: an append-only record of intent and action

For every action, record who asked, which agent acted, the grant it used, the inputs, the policy decision and the result. Write it somewhere the agent can't edit.

This isn't paperwork. It's how you debug a non-deterministic system, and it's what regulators are converging on. In the EU, the AI Act's transparency duties under Article 50 have applied since 2 August 2026, and the "Digital Omnibus" amendment moved the high-risk obligations to 2 December 2027 for Annex III systems and 2 August 2028 for systems embedded in regulated products (Regulation (EU) 2026/1744; European Commission). The delay doesn't remove the obligation. It's a runway for building logging and oversight before they're mandatory. Teams that build the evidence plane now will treat those deadlines as a non-event.

5. Kill switch: revocation measured in seconds

When something goes wrong, and with probabilistic systems at scale it will, you need to answer one question fast: how long does it take to stop every instance of this agent, everywhere, and revoke everything it holds?

If the honest answer is "we'd redeploy," you don't have a kill switch. You need central revocation of agent credentials, a circuit breaker at the gateway per agent and per tool, and automatic tripping on anomalies such as a spike in denied calls, unusual tool sequences or budget burn far above normal. OWASP's ASI08 (cascading failures) is exactly the scenario where seconds matter.

The design principle underneath all five

Put the boundary where the model can't reach it.

Everything in a system prompt is advice. Everything in the gateway, the token and the database is law. A well-designed agent system works safely even with a fully compromised model, because the model never held the power to do damage. It held the power to ask.

That's the same principle we already apply to every other untrusted workload: containers don't police themselves, browsers sandbox the JavaScript they run, and banks don't let tellers approve their own overrides. Agents are the newest untrusted workload, and they're also the most persuasive one, because they can write a convincing explanation for anything they do. OWASP gave that its own entry (ASI09) for a reason.

A maturity test you can run this week

Ask your team these five questions. Each "no" is a gap in one plane.

  1. Identity: Can we tell from the logs which agent took an action, separately from which user or service account?
  2. Authority: Does any agent hold a credential that would still work if it were copied to an attacker's laptop and used tomorrow?
  3. Mediation: Is there any tool an agent can call without passing through a policy check we control?
  4. Evidence: Could we reconstruct, from immutable records, why an agent took its last 100 actions?
  5. Kill switch: Can we revoke one agent's access everywhere in under a minute without a deploy?

Every "no" is a place where your security depends on the model choosing to behave. That's fixable, and fixing it has a payoff beyond risk. It means the competitive edge in agents won't come from the smartest model. Everyone rents that from the same handful of labs. It comes from being the team that can safely give an agent more authority than your competitors dare to.

Autonomy is a budget. The control plane is how you earn more of it.


Michael, ArkNet Digital: AI agents, MCP infrastructure, security and GRC engineering. arknet.digital

If you're putting agents into production and want a second pair of eyes on the identity, policy or audit layer, I'm happy to talk. And if you think one of the five planes is unnecessary, make the case in the comments.

來源:DEV Community · dev.to