Sovereign AI for Business · France & EuropeData · Models · Human sign-off

What security safeguards to put around an AI agent

Facts checked on

The short answer

Treat every document, email and web page the agent reads as untrusted input that can carry instructions. Give the agent its own least-privilege identity, only the tools it needs, and a human approval step before anything leaves the company. Put a gateway in front of the model with token limits and content filters, keep full logs in your own store, and test prompt injection before go-live. OWASP, ANSSI, BSI, NCSC and NIST all point the same way.

Why an agent needs more than chatbot security

A chatbot answers. An agent reads your mail, opens files, calls tools and takes actions. Every new tool is a new way for a bad instruction to become a real action. That is why Anthropic advises starting with the simplest design that works and building an agent only when a fixed workflow cannot do the job (Building effective agents). The fewer things an agent can do, the fewer things can go wrong.

The safeguards below draw on the main public guidance: OWASP's two Top 10 lists, OpenAI's and Anthropic's builder guides, Mistral's guardrails, Microsoft Foundry's controls, NIST, ENISA, ANSSI (France), BSI (Germany) and the UK NCSC.

The threats specific to AI agents

Velok summary of the risks named in the sources listed on this page, read 17 November 2026.
ThreatWhat it looks likeNamed by
Prompt injection, directA user types instructions that override the agent's rules ("ignore your instructions and...")OWASP Top 10 for LLM; Claude docs on jailbreaks
Prompt injection, indirectHidden instructions sit in an email, PDF, web page or ticket the agent reads, and the agent obeys themOWASP; Anthropic research on browser-use agents
Excessive agencyThe agent has more tools, rights or autonomy than the task needs, so one mistake does real damageOWASP Top 10 for LLM and for Agentic Applications
Data leakage and exfiltrationThe agent reads confidential data, then sends it out through a web search, an email or a linkOWASP; Mistral private data guard; Defender for AI alerts
Tool misuseA legitimate tool (payments, file delete, CRM update) is called with the wrong arguments or for the wrong personOWASP agentic list; Mistral guardrails
Supply chainA model, plugin, MCP server or library you did not build behaves badly or changes under youNIS2 Art. 21(2)(d); NCSC guidelines; ETSI EN 304 223
Cost abuseLoops, long prompts or abuse run up tokens with no ceilingMicrosoft: Azure OpenAI has no hard spend limit

Indirect prompt injection is the one most teams underestimate. Any agent that reads outside content (customer emails, supplier PDFs, web pages) will meet it. No model vendor claims to have solved it: Anthropic describes measuring and reducing it with classifiers, training and red teaming (prompt injection defenses). Design so that a fooled agent still cannot do much harm.

Safeguards: control, what it stops, how, who owns it

Velok safeguards table. Owners are suggestions for a 200 to 2,000-person company.
ControlWhat it stopsHow to implementOwner
Own identity per agent, least privilegeExcessive agency, lateral movementEntra Agent ID or a dedicated service account; read-only by default (agent identity)IT / identity team
Tool allow-list per agentTool misuseList each tool and its allowed arguments; block the rest with policy guardrails (Mistral guardrails)Product owner
Human approval before external actionsInjection turning into real damageApproval step for send, pay, publish, delete, decide about a personBusiness owner
Input and output guardrailsDirect injection, harmful outputPrompt Shields and content filters (content filters), Mistral moderation (moderation), Agents SDK tripwires (guardrails)Engineering
No internet after private dataExfiltrationDisable web search once the agent has read private data (private data guard)Engineering
Per-user authorisation in the appOne user reading another's threadsCheck rights in your code: Foundry Agent Service "doesn't enforce per-user authorization on conversations" (baseline)Engineering
AI gateway with token limitsCost abuse, runaway loopsAPI Management llm-token-limit per key or team (AI gateway)IT ops / Finance
Private network, egress filteringData leaving by unknown routesPrivate endpoints, firewall with FQDN allow-listIT ops
Runtime threat detectionJailbreak, data leakage, credential theftDefender for AI services alerts (Defender for AI)CISO / SOC
Full logs in your own storeUndetected misuse, no evidencePrompts, tool calls, approvals and outputs to your log workspaceCISO
Red-team before go-liveKnown attacks reaching productionAdversarial tests incl. injected documents (OpenAI safety practices)Security + product
Model and vendor fileSupply-chain surprisesPer model: provider, version, hosting, data terms, change noticeDPO / procurement

The three zones of agent actions

Sort every action an agent can take into one of three zones before it goes live, and write the list down. OpenAI's guide treats human intervention as a core part of agent design (practical guide); this is how we make it concrete.

ZoneRuleExamples
AutomaticReversible, internal, read-only or draftSearch documents, summarise a thread, draft a reply, fill an internal field, create a ticket
Needs human approvalLeaves the company, moves money, deletes, or affects a personSend an email, publish, pay or refund, delete records, change access rights, any decision about an employee or customer
NeverBanned by law or by your policyPractices prohibited by AI Act Art. 5 (such as social scoring or emotion recognition at work), final decisions about people with no human sign-off, actions on systems outside the agent's list

Logging and incident response

Log, in your own store: who asked, the prompt, the documents retrieved, every tool call with arguments, every approval and who gave it, the output, the model and version, token counts. On Azure, API Management can send prompts and completions to Azure Monitor, and all diagnostics belong in your Log Analytics workspace. For high-risk uses, the AI Act requires deployers to keep logs "of at least six months" (Art. 26); we use six months as the floor for every agent.

  1. Stop: a kill switch that disables the agent or one tool in minutes, owned by a named person.
  2. Contain: revoke the agent's credentials and tokens; block the gateway key.
  3. Read the logs: which inputs, which tool calls, which data left, to whom.
  4. Report: check NIS2, GDPR breach and, for high-risk systems, AI Act serious-incident duties with your DPO and counsel.
  5. Fix and retest: add the attack to your red-team suite before switching back on.

What ANSSI, BSI, NCSC and the others say

SourceWhat it isUse it for
ANSSI (France, 2024)35 recommendations for securing a generative AI system across training, deployment and productionThe French reference your RSSI will ask about
BSI (Germany)Opportunities and risks of generative AI models, with threats and countermeasuresThreat list for German IT and works council discussions
NCSC guidelines (UK, with CISA)Secure AI development across design, develop, deploy, operateLifecycle structure
AI Cyber Security Code of Practice / ETSI EN 304 22313 principles from design to end of life; the UK code became a European standard (v2.1.1, Dec 2025)Supplier questionnaires
ENISA FAICPLayered good practices for AI securityMapping AI onto your existing security programme
NIST AI RMF and AI 600-1Govern, Map, Measure, Manage; 12 generative AI risks with about 200 actionsGovernance structure
OWASP LLM Top 10 and Agentic Top 10Ranked risks for LLM and agentic appsTest cases for your red team

Our opinion: pick one as your backbone (ANSSI in France, BSI in Germany, NCSC/ETSI in the UK, NIST or ENISA elsewhere) and use OWASP for testing. Mixing all of them produces paperwork, not security.

A 20-item checklist before production

  1. Written purpose and scope for the agent, with a named business owner.
  2. A fixed workflow was considered first and rejected for a stated reason.
  3. The agent has its own identity, not a person's account.
  4. Its rights are read-only except where a write is listed.
  5. Tool allow-list with allowed arguments for each tool.
  6. Every action sorted into automatic, approval or never.
  7. Approval screens show the action and the data before the click.
  8. Outside content (email, files, web) is treated as untrusted input.
  9. Web access is off once private data has been read.
  10. Input and output filters are on and tested.
  11. Per-user authorisation is enforced in the app.
  12. Model calls go through a gateway with token limits.
  13. Network is private; egress is limited to listed destinations.
  14. Prompts, tool calls, approvals and outputs are logged in your store for at least six months.
  15. Runtime alerts go to the team that answers security alerts.
  16. A kill switch exists, is tested and has a named owner.
  17. Red-team run done, including injected documents and emails.
  18. Model and vendor file written: provider, hosting, data terms, retention.
  19. DPIA checked with the DPO; workers' representatives informed where required.
  20. Users know they are dealing with AI and have had training (AI Act Art. 4 and Art. 50).

What regulators expect

  • AI Act, now: Art. 5 prohibitions apply since 2 February 2025; Art. 4 (supporting staff AI literacy) and Art. 50 (telling people they are dealing with AI) apply today (Service Desk timeline).
  • AI Act, human oversight: Art. 14 and Art. 26(2) set the oversight duties for high-risk systems. For Annex III uses (recruitment, employee evaluation, credit scoring, essential services) they apply from 2 December 2027, as amended by Regulation (EU) 2026/1744. Deployers must assign oversight to people with "the necessary competence, training and authority", monitor and suspend on risk, report serious incidents and keep logs (Art. 26, AI Act). The date moved; the duties did not go away.
  • NIS2: for medium and large entities in covered sectors, supply-chain security (Art. 21(2)(d)) pulls AI and cloud vendors in through your contracts, and management bodies must approve the measures and are liable (Art. 20). In force in Germany since 6 December 2025 and the Netherlands since 15 August 2026; in France the transposition bill was in parliamentary debate from 10 November 2026.
  • DORA (financial firms, since 17 January 2025): a model API or agent platform supporting a critical or important function is an ICT third-party service, with contract clauses (Art. 30), exit strategy and the register of information. Microsoft, AWS and Google Cloud were among the 19 critical providers designated on 18 November 2025 (ESAs); that does not reduce your own accountability.
  • UK: no AI act; the NCSC guidelines and ETSI EN 304 223 are the security baseline, and UK firms selling into the EU are caught by the EU AI Act.

Velok is not a law firm: check scope and dates with your counsel. For the full list of deployer duties, see what the AI Act requires from deployers.

Frequently asked questions

What security controls do we need before giving AI agents access to email and documents?

A dedicated least-privilege identity for the agent, a tool allow-list, input filters for injected instructions, no web access after private data is read, and human approval before anything is sent. Log every tool call in your own store and run a red-team test with poisoned emails and PDFs before go-live.

How do we stop prompt injection and data exfiltration in AI agents?

You reduce it; nobody has fully solved it. Filter inputs (Prompt Shields, Mistral moderation), limit tools, cut internet access once private data is in context, and require approval for outbound actions. Then a fooled agent cannot do much.

What does the ANSSI, BSI or NCSC guidance say we must do to secure a generative AI system?

ANSSI gives 35 recommendations across training, deployment and production; BSI lists threats and countermeasures for generative models; the NCSC and the ETSI EN 304 223 standard set 13 principles from design to end of life. They are guidance, not law, but auditors and NIS2 supervisors use them as the reference.

How do we log and audit what an AI agent did on our systems?

Log the request, retrieved documents, every tool call with arguments, approvals, output, model version and tokens, in a store you control. Keep at least six months, the AI Act floor for high-risk deployers. On Azure, API Management and Log Analytics cover the model side; your app must log approvals.

Does zero data retention really mean nothing is stored?

Not always. Zero retention or modified abuse monitoring usually covers prompts kept for abuse review, while stateful features such as threads, files and vector stores are stored until you delete them. On Azure, check the resource shows ContentLogging=false and list which features hold data.

How do we connect AI agents to our systems without giving them too much access?

Give each agent its own identity with read-only rights by default, list the tools and arguments it may use, and route writes through an approval step. Review the rights every quarter, as you would for a contractor.

Sources

  1. Anthropic: Building effective agents (read on 17 November 2026)
  2. Anthropic: prompt injection defenses (read on 17 November 2026)
  3. Claude docs: mitigate jailbreaks and prompt injections (read on 17 November 2026)
  4. OpenAI: A practical guide to building agents (PDF) (read on 17 November 2026)
  5. OpenAI: safety best practices (read on 17 November 2026)
  6. OpenAI Agents SDK: guardrails (read on 17 November 2026)
  7. Mistral docs: agent guardrails (read on 17 November 2026)
  8. Mistral docs: safety and moderation (read on 17 November 2026)
  9. Mistral cookbook: private data guard (read on 17 November 2026)
  10. Microsoft Learn: agent identity (Entra Agent ID) (read on 17 November 2026)
  11. Microsoft Learn: content filters and Prompt Shields (read on 17 November 2026)
  12. Microsoft Learn: Defender for Cloud threat protection for AI services (read on 17 November 2026)
  13. Microsoft Learn: Zero Trust for agentic systems (read on 17 November 2026)
  14. Microsoft Learn: AI gateway capabilities in API Management (read on 17 November 2026)
  15. Microsoft Learn: baseline Foundry chat reference architecture (read on 17 November 2026)
  16. Microsoft Learn: data, privacy and security for models sold by Azure (read on 17 November 2026)
  17. Microsoft Learn: plan and manage costs for Microsoft Foundry (read on 17 November 2026)
  18. OWASP Top 10 for LLM Applications (read on 17 November 2026)
  19. OWASP Top 10 for Agentic Applications 2026 (read on 17 November 2026)
  20. NIST AI Risk Management Framework (read on 17 November 2026)
  21. NIST AI 600-1: Generative AI Profile (PDF) (read on 17 November 2026)
  22. ENISA: multilayer framework for good cybersecurity practices for AI (read on 17 November 2026)
  23. ANSSI: security recommendations for a generative AI system (read on 17 November 2026)
  24. BSI: Generative AI models, opportunities and risks (read on 17 November 2026)
  25. NCSC: guidelines for secure AI system development (read on 17 November 2026)
  26. UK government: AI Cyber Security Code of Practice (read on 17 November 2026)
  27. ETSI EN 304 223 v2.1.1 (PDF) (read on 17 November 2026)
  28. EU AI Act, Regulation (EU) 2024/1689 (EUR-Lex) (read on 17 November 2026)
  29. AI Act Article 26 (deployer obligations), consolidated reading (read on 17 November 2026)
  30. AI Act Service Desk: implementation timeline (read on 17 November 2026)
  31. ESAs: designation of critical ICT third-party providers under DORA (read on 17 November 2026)

Velok is not a law firm. This guide documents technical choices and public sources; it does not replace advice from your DPO or counsel.

Apply this guide to your infrastructure.

Scope a first project