Back
Article

How do you make an AI agent Secure by Design?

Amber Bennoui
Product Leader, AI and Cybersecurity, DataRobot

Who will build the next agent in your company? It’s likely not a developer. Business users are all rapidly becoming builders. However, the concepts they're learning by interacting with agent-building tools aren't necessarily security-oriented. And that's a problem.

First and foremost, it exposes the fundamental tension in the article's title. It's not just about how you, a security practitioner, can make an AI agent Secure by Design.‍

Securing agents is now a team sport, and the security team plays a different position. Instead of owning every control yourself, you carry the parts builders shouldn’t have to think about and make the rest easy. Teach people who care little about security the handful of decisions that are theirs, and make the safe path the default. Ask them to pick a design pattern or an identity model, and you’ll get nowhere.

Secure by Design principles accommodate this thinking. The first principle states that the security burden shouldn't fall solely on the customer. And builders are, confusingly, customers in this case.

In this article, we'll cover three things: the concepts, how to create guardrails for builders, and what you should ask them to do. 

What Secure by Design means

While the concept has been around for over 50 years, CISA and its partner agencies described modern Secure by Design principles in 2023, in Shifting the Balance of Cybersecurity Risk:

  • Take ownership of customer security outcomes. The manufacturer carries the burden, and products are safe out of the box, without extra configuration.
  • Embrace radical transparency and accountability. Share what you learn about your product's weaknesses.
  • Lead from the top. Executives own security as a business requirement.

Two later documents, co-authored by CISA, apply them to AI: the Guidelines for Secure AI System Development and eful Adoption of Agentic AI Services. 

For agents, Secure by Design means that when the agent absorbs malicious input, that input should have nowhere useful to go, and when the agent errs on its own, the damage stays small and reversible.

The builders

You now have four categories of builders.

Who Typical tools What they can own
Security and platform team The agent platform’s admin settings, IAM, and gateways Defaults, approved connectors, agent identity, logging, revocation, and the review gate
Pro developers Agent frameworks, MCP servers, code Architecture: design patterns, tool supply chain, testing
Business builders No-code builders inside SaaS and productivity suites A handful of plain decisions and honest answers at the gate
Third parties SaaS vendors, desktop, browser, and cloud-hosted agents Nothing, except the access you grant

In theory, the more you offload to the security and platform team, the less is required from the business builder. That way, a business builder who just clicks through the default options still gets a relatively safe agent.

As anyone who's done agentic discovery knows, the reality is far messier. You're bound to find agents outside the purview of the professionals. 

The theory

Jerome Saltzer and Michael Schroeder of MIT published a set of design principles in 1975 in “The Protection of Information in Computer Systems”. Fifty years later, Open Security Architecture still calls them “the canonical reference” for building systems that fail safely. Here is how seven of those principles apply to AI agents:

Principle What it means for an agent
Least privilege Scope access to the task, not to the owner. Credentials expire when the job ends.
Fail-safe defaults No tools, egress, or data until granted. When a call falls outside its scope, the agent stops and escalates.
Complete mediation Authorize every tool call, not the session. An “allow” that is checked once at startup goes stale.
Separation of privilege Irreversible actions need a second key: a human, or a component the agent can’t talk around.
Economy of mechanism Fewer tools, servers, and paths. Every tool is an attack surface.
Open design Don’t rely on a secret system prompt. Assume the attacker has read it.
Psychological acceptability The secure way to build an agent has to be the easiest way, or builders will go around it.

Then there's reversibility. Drafting a memo is easily reversible; sending it is not. The same goes for sending money or deleting files. Things that are difficult to reverse should have more stringent gates in front of them.

Finally, there's the "Agents Rule of Two", authored by Meta in October 2025, which builds upon Chromium's rule of the same name.

Until prompt injection can be reliably detected and refused, an agent must have no more than two of these in a single session:

  • [A] It processes untrusted input.
  • [B] It can access sensitive systems or private data.
  • [C] It can change state or communicate externally.

With all three, an email can tell the agent to read your inbox and forward it to the attacker. And if a task absolutely requires all three, an agent needs human approval or another reliable check, or has to start a fresh session. Treat the rule as a ceiling, not a clean bill of health: an agent with two of the three still needs least privilege.

Among the scenarios this doesn't account for in theory are rogue actions. That's when the agent causes harm with no attacker involved, by misreading a request, hallucinating a tool call, or overreaching. In practice, you also have things like approval fatigue, when a human acts as a rubber stamp.

The platform team: make the safe path the easy one

This is where CISA's first principle gets concrete. Set these properly, and the business builders will have fewer opportunities to make security mistakes.

Default Why Who can change it
Only approved connectors and tools are available Builders can pick from a safe list Platform owner
No egress or file access unless granted Fail-safe The platform owner can grant access following a review
Memory cleared at session end Poisoned context, including memory written after reading untrusted input, shouldn’t persist Platform owner, per source
Human approval of destructive and/or irreversible actions Separation of privilege Agent owner can add actions; removing one needs platform owner sign-off
Rate, volume, and spend guardrails Limit the blast radius; runaway loops alert security, not just finance Agent owner, within a ceiling the platform owner sets
Logging on, with a correlation ID that follows every sub-agent and MCP hop and records who the agent acted for Security and compliance Nobody
Deny and escalate any tool call outside the agent’s declared scope Fail-safe Nobody
Agent-written code runs in a sandbox with no egress Fail-safe Nobody

Issue the identity for them. Ideally, the platform gives each agent an identity that is registered and bound to roles. This way, a business builder won't have to handle credentials, and the agent won't run on the builder's login. When the agent acts for a user, its effective permissions should be the intersection of the user's and the agent's, so it never exceeds either.

Widen access gradually. New agents should start with one team and a narrow scope. If something goes wrong, fewer people are affected, and it'll be easier to roll back to a known-good version.

Keep a working off switch. Confirm before launch that you can revoke a single agent: its tokens are invalidated, in-flight runs stop, and it loses access everywhere it connects.

Pro developers: build patterns that hold when the model doesn't

Code-built agents get the same platform defaults, as well as architecture decisions a no-code builder never touches.

Pick the narrowest pattern

In June 2025, researchers from ETH Zurich, IBM, Google, Microsoft, Invariant Labs, and others published six prompt injection-resistant design patterns for agents. They share one rule: once the agent has absorbed untrusted input, that input can't trigger an action with meaningful consequences.

Pattern How it works What an injection can still do Paper’s case studies
Action-selector Request maps to one or more predefined actions, and the tool output never flows back Nothing through the tool output Customer service chatbot
Plan-then-execute The plan is fixed before any untrusted data is read Change a planned action’s content, but not add one Email and calendar, SQL agent
LLM map-reduce Each untrusted item is routed to an isolated, tool-less sub-agent that returns a constrained result Mislabel its own item Résumé screening, product recommender
Dual LLM The privileged model has tools but never sees untrusted data; the quarantined model reads untrusted data but has no tools, and its output is constrained or passed by reference Affect only the quarantined model’s output Booking assistant, software engineering agent
Code-then-execute The agent writes a program that calls tools and quarantined models Change data values, not control flow Email and calendar, booking assistant
Context-minimization User’s prompt is dropped from context once it becomes a query or action Anything via third-party data; it only limits injections in the user’s own prompt Customer service and medical chatbots

Each pattern gives up flexibility, which is exactly the point. An agent that can do anything can be talked into anything, so it should be able to do as little as possible while doing its job.

Control the supply chain

Agents tend to have extensive supply chains, which come with their own dangers. Every MCP server, plugin, and tool is code you didn't write. Here, too, reducing flexibility is the security-minded move, and so is verifying signed provenance for the models, datasets, and MCP servers you load. 

  • Allow-list tool sources. Pin versions, hash tool definitions at approval, and diff them at every session start to catch tool poisoning and rug pulls.
  • Red-team in a sandbox, and run agent-written code in a sandbox in production.
  • Re-test on every change. Updates to approved tools are classic opportunities for supply chain attacks, so re-verify pinned tools before accepting an update. 
  • Run capability evaluations continuously on every change to the model, prompt, or tool set, and block releases on regression,, because a new model or tool can change how the agent behaves.

Hand this to your business builders

Business builders are unlikely to care about everything written above. Their checklist is more informational, designed to align them with the security team as easily as possible. Here's a sample message you can send business builders:

Before you switch your agent on

  1. Say what it's for and who it's for in one sentence. Register it, so we know it exists.
  1. Answer three questions:
  • Does it read anything from outside the company, like customer emails, web pages, or uploaded files?
  • Can it see anything you can see in our systems, or any customer, financial, HR, or other private data?
  • Can it send, pay, change, delete, or post anything without you checking first?

Yes to all three? Talk to security before you turn it on. We'll help you secure it.

  1. Use the approved connectors only. Don't sign the agent into our systems with your own account, and never paste a password or API key into it.
  1. Keep yourself in the loop for anything irreversible.
  1. Start small. Make sure it works, then give it to others.
  1. Name a backup owner. If you change roles, hand the agent over, or switch it off and ask us to revoke its access.
  1. If it does something odd, switch it off and tell us. You won't be in trouble for it.
  1. Bringing in an agent you didn't build? Same questions, before you connect it to anything.

Lead from the top: the review gate

A senior person has to decide whether to launch based on the answers to these questions.

The builder answers Security checks Artifact
What is it for, and who owns it? The owner and backup are real people Registry entry
The three questions Which Rule of Two properties apply, and what control is on the third Gate record
What can’t be undone? Approval steps are configured Agent configuration
Which connectors does it use? All are on the approved list Connector list
Who will use it first? Scope matches the first stage of rollout Rollout plan
(Code-built agents) Which pattern? Pattern fits the risk; tools are pinned; red-team done Architecture diagram, test report

Agents you didn't build

Discovery will show you the fourth kind of builder: someone outside the company. 

Increasingly often, a SaaS vendor switches on an agent inside a tool you already pay for. Employees install agents on their devices or sign up for hosted personal AI agents. None of these run on your platform, so defaults don’t apply. 

You can't design someone else's agent, but you do design and own the doors it comes through. While you’re not strictly making the agent “Secure by Design”, it’s adjacent enough to be within the scope of the process. 

Door Default
OAuth consent Admin approval for agent apps asking for broad or offline access
Agents built into your SaaS Off until reviewed, then on per team
Desktop agents and browser extensions Allow-listed. Also, no production credentials on the device
API keys and tokens Issued by the platform, scoped and expiring, never personal
The user’s own login Managed devices only, phishing-resistant MFA, sessions bound to the device
Egress Approved AI endpoints only
Remote MCP servers Admin-managed catalog only; personal connections off by default

Then apply the Rule of Two from the outside. You can't change how the agent handles untrusted input, but you decide whether it gets reads and writes.

Some agents skip the doors entirely. As of October 2026, Muse, Grok Bot, and Dots are among those that get their own cloud computer and sign in to your tools the way an employee would, including tools with no API. 

The main control left here is conditional access: deciding how your identity provider treats a sign-in from a machine it has never seen.

That's the Secure by Design lesson in reverse. If the safe path is slower than the easiest path, people will choose the easy one. Making your platform the easy option should be paramount. CISA has a name for the customer side of all this: Secure by Demand. 

Operation and maintenance

Once the agent runs, you find out which design choices made it in. The rest of this series covers this phase:

And from CISA's transparency principle: when an agent fails, tell the builders. A brief note on what went wrong helps make the next agent better.

If you're buying, not building

When a vendor ships the agent builder itself, CISA's transparency principle is your leverage. Add these to the vendor questions in How do you extend Zero Trust to AI agents?:

  • Can you limit builders to an approved list of connectors?
  • Does each agent get its own identity, or does it run on the builder's login?
  • What's on by default, and what can your admins lock?
  • Can you revoke a single agent, including its tokens, and how fast?
  • Can we export every agent action to our SIEM, with the correlation ID and the human it acted for?
  • Can you provide an AI-BOM and signed provenance for the models and tools you ship?