跳到正文
DEV Community· Durgesh·· 52 分鐘前AI 評分55

AI 智能體安全不只是模型問題:正式投入生產前需修補的 9 項基礎設施缺口

AI Agent Security Isn’t a Model Problem: 9 Infrastructure Gaps to Fix Before Production

AI 導讀

文章列出 AI 智能體投入正式環境前需處理的 9 項基礎設施安全缺口,主張防護應涵蓋執行環境,而非只依賴提示詞或模型權重。建議為每個智能體配置獨立身份、採用最小權限及短期 token、妥善管理密鑰,並把外部資料視為不可信,審核 MCP 伺服器及限制權限委派。文章亦建議為高影響操作設置人工批准,並加入熔斷、用量上限、即時撤銷機制和完整執行記錄。

正文
  1. Shared Accounts → No attribution

When multiple agents share a single service login, incident response breaks down—you can’t tell which agent took an action.
• Fix: Provision a distinct, non-human identity for every agent. Never share credentials.

  1. Over-Privileged Tokens → Unnecessary blast radius

To get demos working quickly, agents are often handed broad, long-lived API keys. One hallucination or loop can wipe production data.
• Fix: Enforce least-privilege, task-scoped permissions with short-lived, auto-expiring tokens.

  1. Secrets in Prompts → Leaked credentials

Pasting API keys or passwords directly into system prompts guarantees they will end up in LLM traces, chat histories, and observability logs.
• Fix: Store credentials in a secrets manager and inject them strictly at the tool-execution layer—never into the context window.

  1. Prompt Injection → Untrusted execution

Malicious instructions hidden inside an external email, PDF, or webpage can hijack an agent's control flow.
• Fix: Treat all external data as untrusted. Sanitize inputs, separate data from instructions, and strictly restrict accessible tools.

  1. Unvetted MCP Servers → Supply-chain exposure

Connecting agents to random, unverified Model Context Protocol (MCP) servers introduces unreviewed code and potential data exfiltration paths.
• Fix: Maintain an internal allowlist of security-reviewed MCP servers and pin their versions.

  1. Agent-to-Agent Privilege Escalation → Compounding permissions

When Agent A delegates a task to Agent B, permissions often stack up—allowing a low-privilege agent to trigger high-privilege actions through a proxy.
• Fix: Propagate the original user's identity and permission scope down the chain, and limit delegation depth.

  1. Missing Human-in-the-Loop (HITL) → Unchecked side effects

Giving agents autonomous write-access to sensitive systems leads to costly mistakes—like issuing an unapproved $2,000 refund or emailing external clients.
• Fix: Require explicit human approval gates for high-impact actions (payments, deletions, external communications).

  1. No Kill Switch → Runaway loops and spend

An agent caught in a recursive retry loop can burn through 10,000 API calls and thousands of dollars before anyone notices.
• Fix: Implement circuit breakers, hard rate/budget caps per session, and an immediate revocation mechanism.

  1. Missing Audit Logs → Zero forensics

Without structured execution logs, debugging failures or passing compliance audits becomes impossible.
• Fix: Log every tool invocation with its inputs, outputs, agent identity, user context, and approval trail.

The Blueprint in Short

• Identity & Access: Gaps 1, 2, 6
• Inputs & Supply Chain: Gaps 3, 4, 5
• Runtime Guardrails: Gaps 7, 8
• Observability: Gap 9
Stop trying to prompt-engineer your way out of infrastructure vulnerabilities. Secure the runtime, not just the weights.

來源:DEV Community · dev.to