Table of Contents

Related Content

Scaling Guest Trust Across 1,000+ Radisson Hotels, With Zero Downtime

Watch our webinars
No items found.

How to Secure AI Agents: A Field-Level Data Control Playbook

November 2, 2026

Securing AI agents means giving them the tool access and data context they need to do real work, while enforcing field-level limits on what they can see and pass along at runtime. Agents act autonomously, so sensitive data moves through prompts, tool responses, and traces without a developer approving each step.

This guide covers the main threats to AI agents, the core requirements and best practices for securing them, and how to protect the sensitive data agents touch at the field level.

‍

Why Securing AI Agents Is a Different Problem Than Securing Software

Conventional software security assumes a fixed attack surface, and AI agents don't have one. Traditional software runs code paths a reviewer approved, so the code itself is the perimeter. An agent picks its own path at inference time. It selects tools and composes API calls from a probabilistic reading of natural language, which changes security in three ways:

  1. The perimeter moves to runtime. Security has to cover the orchestrator, the tools and Model Context Protocol (MCP) servers it calls, agent memory, and the handoffs between agents. None of these existed as an attack surface in a line-by-line code review.
  2. The perimeter can't be audited like a pull request. There's no fixed code path to sign off on before the agent runs, only a choice the model makes at inference time.
  3. Data and instructions share a channel. Emails, retrieved documents, and tool responses arrive in the same channel as the agent's instructions, so untrusted data can act as a command.

Autonomy raises the stakes. OWASP defines Excessive Agency as the vulnerability that lets unexpected, ambiguous, or manipulated LLM output trigger damaging actions. An agent with write access when read-only would do, or one running under a shared high-privilege identity, can turn a single bad output into a production incident.

‍

The Main Security Threats to AI Agents

Most attacks on AI agents never touch the agent directly. Malicious content rides in through the data the agent was built to consume, and these attacks fall into four categories:

  1. Prompt injection: Prompt injection happens when content an agent processes overrides its instructions instead of informing them. Direct injection comes through the user's prompt. Indirect injection hides in tool outputs, retrieved documents, and emails, so it needs no user interaction.
  2. Data and memory poisoning: Data poisoning corrupts a training set or RAG corpus before use. Memory poisoning plants malicious records in an agent's long-term memory, where they persist across sessions. An attacker doesn't need write access. Memory injection research presented at NeurIPS 2025 reached a 98.2 percent success rate using ordinary queries alone.
  3. Multi-agent cascading failures: A cascading failure happens when one compromised agent passes bad data or instructions down a pipeline that trusts it by default. Guardrails often don't follow the handoff. The OpenAI Agents SDK applies input guardrails only to the first agent in a chain, and output guardrails only to the agent that produces the final output.
  4. Supply chain and shadow AI risks: Agents that install dependencies or call unvetted tools let attackers in through hallucinated package names and tools that skipped security review. A USENIX Security 2025 study found 19.7 percent of 2.23 million LLM package recommendations were hallucinated names, which attackers can register with malicious code (slopsquatting).

Countering all four starts with the same foundation: knowing which agents exist and limiting what each one can reach.

‍

Core Requirements for Securing AI Agents

Three requirements come before any tooling decision, and each covers ground that conventional security programs miss:

  1. Discover and inventory active agents. An agent inventory is a live registry of every agent running across cloud and SaaS, with its owner, tools, and data access. Every downstream control depends on this list, because an agent no one can see can't be governed.
  2. Apply least privilege at the field level. For an agent, least privilege means scoping permissions per task and per tool call, down to the individual field, because you can't fully predict an agent's actions at deploy time. The Cloud Security Alliance's MCP security guide calls for evaluating each tool invocation against the agent's current permissions rather than trusting permissions granted once at connection time.
  3. Govern agent identities and credentials. Each agent should carry its own nonhuman identity with a managed lifecycle, from creation to retirement. Short-lived tokens and dynamic secrets replace static API keys and shared service accounts, which tend to outlive the agents they were issued for.

Discovery, least privilege, and identity governance give every operational control that follows something concrete to enforce against.

‍

Best Practices for Securing AI Agents

Once agents are inventoried, scoped, and individually identified, four operational practices cover the day-to-day work:

  1. Validate data at every agent boundary. Check inputs and outputs wherever an agent crosses into a tool, a data source, or another agent. Scope inter-agent permissions separately so one compromised agent can't inherit the pipeline's authority. Many deployments still skip basic controls: a 2026 measurement study found 40.55 percent of 7,973 live remote MCP servers expose tools without any authentication.
  2. Layer prompt injection defenses. No single control stops prompt injection, so combine prompt hardening, input and output filtering, and separately scoped API tokens. Scoping matters most, because an injected instruction can only do what the agent's credentials allow.
  3. Log every tool call and gate high-impact actions. Record each tool call, handoff, and field an agent accesses, and keep raw sensitive values out of traces so logs don't become an exfiltration path. For payments, deletions, and external communications, OWASP recommends human approval before the action runs.
  4. Red team the full agentic workflow. Test orchestration and tool-calling paths alongside the model, and repeat testing as attacks evolve. In agent hijacking evaluations by NIST's Center for AI Standards and Innovation, attack success rose from 11 percent to 81 percent once red teamers built new attacks tuned to the target model.

These practices govern what agents do. Protecting the data that flows through agents takes a separate set of runtime controls.

‍

How to Protect the Sensitive Data That Agents Access

Protecting agent data means controlling what each agent can see or expose at the point of use, without stripping the context it needs to reason. Three decisions shape this: how to transform the data, where to enforce policy, and whether to build the enforcement layer or adopt one.

Preserve Context Instead of Blocking or Stripping Data

Protect sensitive data by transforming individual fields rather than blocking requests or replacing values with generic placeholders. Blocking requests makes the agent useless for the workflows that justified building it. Generic placeholders cost accuracy: in one data sanitization study, Claude 3.5 Sonnet's GSM8K math-reasoning score fell from 96.9 percent to 44.6 percent on redacted data. The authors point to ambiguity as a cause, since replacing two different names with the same <NAME> token makes it harder for the model to tell the people apart.

Simple classification tasks tolerate redaction far better. Multi-step reasoning, which is most of what agents do, doesn't.

Enforce Policy per Field at the Moment of Access

Make the policy decision per field at the moment of access, since an after-the-fact scan only documents an exposure days later. The policy engine should evaluate each request from an agent, tool, or model in context: who is asking, what action they're requesting, and which region and consent rules apply. It then returns only the fields policy permits.

DLP and DSPM tools discover, classify, and monitor data from the outside. Runtime control transforms the data itself, so it stays protected and still usable.

Decide Whether to Build or Adopt Field-Level Control

Build field-level control in-house only if the team can own every layer. That means a detection engine for unstructured text and files, per-entity token maps, and a policy engine spanning every agent and tool. It also means role-based rehydration and field-level audit logging, all running before the first agent reaches production. Teams that can't staff and maintain that stack as agents multiply are better served by a platform that already enforces policy at each point.

‍

How Skyflow Secures the Data Flowing through AI Agents

Skyflow gives teams field-level runtime control without building the enforcement layer themselves. As a Runtime AI Data Control Platform, it applies one policy to the data flowing to models, agents, tools, and logs. Sensitive data lives in a vault, agents work with tokens, and policy decides what each consumer receives on every request. Three capabilities carry most of that work for AI agents.

Agent Input and Output Controls

Skyflow sanitizes prompts before they reach a model and rehydrates authorized values in responses, using two independent policies. A consumer policy controls what the model or agent receives, so a prompt containing a Social Security number reaches a public LLM redacted rather than blocked. A user rehydration policy controls what the person reading the response sees.

From the same agent answer, an auditor gets full values while a support agent sees masked names and a partial SSN. Policy-Based Access Control (PBAC) applies these rules at the row and column level by identity, action, region, and consent, and every access is logged with its policy context.

Tool and MCP Protection

When agents act in enterprise systems such as Workday and HubSpot, Skyflow controls the data exchanged between the agent and each tool or MCP server. The agent retrieves only the fields its policy authorizes, whatever the underlying API returns. The same enforcement applies at handoffs between agents in multi-agent workflows, so trust doesn't pass down the pipeline by default.

Context-Preserving Tokenization

Skyflow's context-preserving tokenization gives each entity its own distinct token instead of collapsing everything to a generic label. The model can still tell Maria from John, or a patient's name from a physician's, while the raw values stay in the vault. That distinction separates an agent that can answer "who is the primary contact and how do I reach them?" from one that never received usable information.

‍

Make AI Agents Data-Ready with Skyflow

Securing AI agents comes down to four workstreams: agent inventory, field-level least privilege, governed nonhuman identities, and runtime control over the data itself. The first three limit what an agent can do. The fourth limits what a compromised agent can expose, because tokenized data yields tokens rather than usable sensitive values.

Book a demo to see how Skyflow could enforce field-level policy across your own agents, tools, and MCP servers.

‍

Frequently Asked Questions About Securing AI Agents

What are the most critical security risks specific to AI agents?

Indirect prompt injection and memory poisoning are the most critical, and excessive agency makes both worse. An agent calls tools, holds credentials, and keeps memory across sessions, so a manipulated input can become a real action.

‍

How do you prevent indirect prompt injection without breaking agent reasoning?

Layer the controls. Combine prompt hardening with input and output validation at every tool and retrieval boundary, and scope each agent's credentials to limit what an injected instruction can reach. Context-preserving tokenization keeps raw sensitive values out of the prompt while entities stay distinct enough to reason over.

‍

How should organizations manage AI agent identities and credentials?

Give each agent its own nonhuman identity with a managed lifecycle. Assign one identity per agent, retire shared service accounts, and replace static API keys with short-lived tokens and dynamic secrets. Documented removal steps keep credentials from outliving the agent.

‍

How do you maintain visibility over what data an agent accessed?

Keep a field-level audit trail. Each record should show which agent acted, which tools and fields it touched, which policy applied, and what the receiving user saw, with raw sensitive values kept out of the trace.

Related Content

Scaling Guest Trust Across 1,000+ Radisson Hotels, With Zero Downtime