Keyfactor Days 2027 – Participez à la conférence « Trust Security » à San Diego Inscrivez-vous dès maintenant !
AI

Qu'est-ce que la sécurité des prompts ? Guide pour sécuriser les directives d'IA 

Prompt security is the AI equivalent of application security for traditional software. Where application security protects compiled programs from exploitation, prompt security protects the natural-language programs that govern agent behavior. Without it, organizations have no reliable mechanism to verify whether the instructions an agent follows are legitimate. 

Why AI prompts need security

The AI industry has reached the point where prompts now trigger autonomous actions. A prompt is no longer a simple line of dialog; it is a directive to perform a task. It is a non-deterministic, natural-language program. This shift from conversational AI to agentic AI changes the security model.

When a chatbot hallucinates an answer, the consequence is inconvenience – for a discerning user. Such a user reads incorrect information, recognizes the error, and moves on. When an autonomous agent acts on a compromised directive, the consequences are material: unauthorized database queries, erroneous financial transactions, infrastructure misconfigurations, or exposure of sensitive data. These are not hypothetical scenarios. They represent the operational reality of deploying AI agents without directive-level security controls.

Unauthorized agent actions can trigger downstream system failures, data exposure, or financial loss. Organizations that treat prompt security as an afterthought face the same category of risk as those that once ignored application security in production web applications.

These risks require controls for directive authenticity, integrity, authorization, timeliness, and semantic safety. Prompt security provides the controls needed to keep AI agents within sanctioned boundaries. See our guide to prompt injection vulnerabilities.

The directive authorization problem

Before any AI agent executes an instruction, teams must answer five questions. Failure to address even one creates an exploitable gap.

Authenticity

Who issued this directive? An agent must be able to verify that a directive originated from a known, trusted source. Without cryptographic proof of authorship, an agent cannot distinguish between a directive from an authorized administrator and one injected by an adversary.

Intégrité

Has anyone modified this directive? Even if a directive originated authentically at the point of creation, someone may have altered it in transit. Integrity verification ensures the directive an agent receives is identical to the directive that the originating system issued. Security controls must detect any modification.

Authorization

Can the issuer request this action? Authenticity confirms identity; authorization confirms scope. A verified user may authenticate to interact with an agent, but may lack the authorization to instruct it to access financial records, modify infrastructure, or bypass approval workflows.

Timeliness

Is this directive current? A valid directive issued a few seconds ago may be dangerous if an attacker replays the directive and causes it to execute twice. Replay attacks resubmit previously legitimate instructions at unauthorized times. Timeliness controls, such as timestamp enforcement and nonce validation, ensure the system executes directives only within their intended validity window.

Semantic safety

Does the content of this directive fall within expected behavioral boundaries? Even an authentic, unmodified, authorized, and timely directive can contain instructions that violate organizational policy. Semantic analysis evaluates the intent and scope of a directive against defined behavioral constraints.

No single mechanism answers all five questions. Effective prompt security layers complementary controls so that at least one enforcement point addresses each one. Cryptographic signing handles authenticity and integrity. Access control policies handle authorization. Timestamp enforcement handles timeliness. Semantic analysis handles behavioral boundaries. The architecture must combine all of these.

The importance of prompt security

The Open Worldwide Application Security Project (OWASP) Top 10 for Agentic Applications (2026) ranks Agent Goal Hijack, which ties directly to prompt security, as the number one risk. Goal hijacking occurs when an attacker manipulates an agent’s directives to override its intended objectives, effectively turning the agent into a tool for unauthorized actions.

This risk is broader. Multiple entries in the OWASP agentic top 10 connect directly to the prompt security discipline:

  • ASI01, Agent Goal Hijack The main prompt risk. Attackers manipulate agent behavior through compromised directives, changing the agent’s goals, plans, and affecting its decision-making.
  • ASI02, Tool Misuse and Exploitation Agents invoke tools outside their intended scope because teams did not enforce directive boundaries.
  • ASI05, Unexpected Code Execution (RCE) A prompt security failure escalates into code execution when code generated or triggered by agents runs without sufficient validation.
  • ASI06, Memory and Context Poisoning Attackers poison the long-term context that future prompts rely on, causing persistent influence over reasoning, planning, and tool usage across sessions.
  • ASI08, Cascading Failures A successful prompt attack against one agent can propagate through dependent agents, tools, and workflows, amplifying a localized prompt vulnerability into a system-wide failure.

Each of these risks traces back to a failure in directive authorization. When organizations cannot verify who issued an instruction, whether someone modified it, or whether the issuer had the authority to make that request, agents become attack surfaces.

Understanding how prompt injection attacks exploit these boundaries is essential for security teams assessing their exposure. Equally important is implementing practical countermeasures for prompt injection that address these risks at the architectural level.

Prompt security vs. traditional application security

The parallel between prompt security and traditional application security is direct. While traditional applications are deterministic programs developers write in languages like Java or C++, in the agentic AI era, an agent prompt is a non-deterministic program that developers write in natural language. The same security principles apply; the enforcement mechanisms must adapt.

Les professionnels de la sécurité connaissent déjà les domaines qui nécessitent une protection. Prompt établit des cartes de sécurité pour chacun d'entre eux.

Attack surfaces

Les applications traditionnelles protègent contre les injections SQL, les attaques de type « cross-site scripting » et les débordements de tampon. Les agents IA sont quant à eux exposés aux injections de prompt, à la manipulation du contexte et aux violations des limites des directives. Dans les deux cas, le problème fondamental réside dans le fait que des données non fiables parviennent au moteur d'exécution sans avoir été soumises à une validation adéquate.

Identity and access

Authentication, authorization, session management, and privilege escalation are foundational to both disciplines. An AI agent that cannot verify the identity of a directive’s issuer is equivalent to a web application that accepts unauthenticated requests.

Data protection

La validation des entrées et des sorties, l'accès non autorisé aux données et la gestion des informations confidentielles s'appliquent tout autant aux agents traitant des instructions en langage naturel. Un agent qui divulgue des invites système ou des configurations d'outils internes s'expose au même type de risque de fuite de données qu'une application qui divulgue des identifiants de base de données.

Supply chain

La confiance dans les dépendances, l'intégrité des plugins tiers et la vérification des sources sont essentielles dans ces deux domaines. Un agent qui charge des outils ou des directives provenant de sources non vérifiées hérite de toutes les vulnérabilités que ces sources comportent.

Detection and auditability

La détection des anomalies, la journalisation, les pistes d'audit, la transparence et les tests constituent la couche de détection tant dans la sécurité traditionnelle que dans celle basée sur l'IA. Sans une journalisation exhaustive des directives reçues, des actions entreprises et des résultats obtenus, il est impossible de mener une enquête sur les incidents.

Opérations

La gestion des incidents, le contrôle de l'étendue des répercussions et les capacités d'intervention humaine constituent des exigences opérationnelles, que le système à protéger soit un microservice en conteneur ou un agent autonome.

What makes prompt security harder is the fundamental nature of the input. Traditional input validation relies on deterministic pattern matching: web applications firewalls (WAFs), regular expressions, and schema validation. Natural language is inherently ambiguous. People can express the same instruction in countless ways, and attackers specifically craft adversarial prompts to evade syntactic filters. This ambiguity means that perimeter-level controls alone are insufficient. Prompt security requires defense-in-depth architectures that combine cryptographic, policy-based, and semantic controls.

The layered security model for AI prompts

Effective prompt security is not a single product or technique. It is an architectural model with five distinct layers, each reinforcing the others.

Layer one: cryptographic trust foundation

The base layer provides signature verification and timestamp enforcement. The issuer of every directive cryptographically signs it, and the receiving agent verifies it before execution. Timestamp enforcement prevents replay attacks by binding each directive to a specific validity window.

This layer makes the others trustworthy. Consider the difference: semantic analysis of an unsigned directive provides conclusions about content of unknown provenance. The analysis might be accurate, but the organization has no basis for trusting the directive’s origin. Semantic analysis of a signed directive allows interpretation of its conclusions with confidence, because the system has already established the directive’s authorship and integrity.

Layer two: authorization scope enforcement

With cryptographic trust established, the authorization layer enforces role-based limits on what each verified issuer can instruct an agent to do. A signed directive from an authenticated user still requires authorization checks. Leaders or teams may permit an engineer to instruct an agent to query monitoring dashboards but not to modify production infrastructure.

Layer three: semantic analysis

AI-powered gatekeepers analyze the content and intent of verified, authorized directives. This layer detects anomalous patterns, policy violations, and behavioral deviations that cryptographic and authorization checks cannot catch. For example, a directive that is authentic, unmodified, and within the issuer’s authorization scope but requests an unusual volume of data transfers at an unusual hour may warrant additional scrutiny.

Layer four: human oversight

High-risk operations require human approval workflows. This layer establishes thresholds based on action severity, data sensitivity, or financial impact. When a directive exceeds defined risk parameters, execution pauses until a human reviewer explicitly approves.

Layer five: lifecycle management and monitoring

The top layer addresses the ongoing operational requirements of prompt security: certificate lifecycle management, signing key rotation, revocation checking, certificate authority (CA) trust updates, and continuous monitoring. Security is not a point-in-time deployment. The cryptographic identities and trust relationships underpinning the entire model require active management throughout their lifecycle.

For more on how cryptographic identity underpins these layers, see securing agentic AI with digital trust.

Prompt security in multi-agent systems

Multi-agent architectures introduce another class of prompt security challenges. In these systems, you may give one agent a prompt, but another agent executes them. As directives pass between agents, these agents can lose context distinguishing trusted system instructions from untrusted user-submitted data. This is the “telephone game” problem of agentic AI.

When Agent A receives a signed directive and delegates subtasks to Agents B and C, those downstream agents must independently verify directive provenance. If inter-agent communication strips or fails to propagate cryptographic signatures, downstream agents operate on instructions of unknown origin.

La sécurisation des architectures multi-agents nécessite un ensemble complet de mesures de contrôle :

  • Unique identities for each agent Every agent in the system must have its own cryptographic identity for AI agents, typically using a digital certificate. This enables mutual authentication and per-agent accountability.
  • Mutual authentication between agents Before any agent accepts a directive from another agent, both parties must verify each other’s identity. Teams cannot assume trust based on network position or deployment context.
  • Explicit permission delegation When Agent A delegates a task to Agent B, teams must explicitly scope the permissions they grant. Agent B should never implicitly inherit Agent A’s full privilege set.
  • Least privilege per agent and per task Each agent operates with the minimum permissions required for its specific function. Teams scope permissions not just to the agent but to the individual task it executes.
  • Sanitization of every inter-agent communication Systems must validate directives at each boundary as they pass between agents. Concatenating untrusted inputs (either generated by a user or by another agent) with system instructions across agent boundaries can have devastating downstream consequences.
  • Per-agent logging and traceable audit trails Each agent logs every directive it receives, action it takes, and result it produces independently. Audit trails must allow reconstruction of the complete directive chain from origin to final execution.
  • Blast radius containment Architectural controls limit the impact of a compromised agent. If an attacker hijacks Agent C, the agents’ permissions, accessible tools, and network reach bound the damage it can inflict.
  • Anomaly detection and kill-switches Automated monitoring detects behavioral deviations in real time. Kill-switches allow operators to halt individual agents or entire agent chains without waiting for the current execution to complete.

[Multi agent security]

Emerging standards and prompt security

The security community is formalizing AI agent and prompt security through ongoing work at the Internet Engineering Task Force (IETF).

An early IETF draft on AI agent authentication and authorization defined how systems identify, authenticate, and authorize AI agents across systems and services. It describes agents as workloads that require structured identity management: identifiers, credentials, and attestation, and ties agent requests to verified identity context and delegated permissions. The IETF Workload Identity in Multi-System Environments (WIMSE) working group has since adopted this work and continued it as draft-ietf-wimse-aims (AI Identity Management System).

A second IETF Internet-Draft on AI agent security requirements organizes security considerations across multiple stages of agent interaction. This draft situates prompts within a broader interaction lifecycle in which infrastructure components mediate requests, such as an orchestrator agent (which the same document defines). In such a lifecycle, prompt inputs would generally fall within these validation, authentication, and policy-enforcement stages. These IETF drafts aim to guide secure prompting and safe AI use. Organizations that invest in cryptographic infrastructure now can adopt these standards as they mature instead of retrofitting controls later.

Prompt security best practices

Effective prompt security follows a repeatable sequence, moving from discovery to cryptographic enforcement to ongoing oversight. Keyfactor’s prompt-signing guidance informs these six practices. Start by applying cryptographic signing and verification to the highest-risk directive paths.

  • Inventory your agentic AI deployments and map the directive flows between users, systems, and agents.
  • Identify which directives carry the highest risk if compromised.
  • Implement cryptographic signing and verification for those high-risk directive paths first, because this is the foundational control.
  • Enforce timestamp-based freshness to mitigate replay attacks.
  • Layer semantic analysis on cryptographically verified content only.
  • Plan for certificate lifecycle management, including automated renewal, revocation checking, and CA trust updates, from the start.

Comment Keyfactor vous aider

Keyfactor provides the cryptographic infrastructure required to implement prompt security at enterprise scale. The same public key infrastructure (PKI) and code signing principles that protect software supply chains, device identities, and workload authentication apply directly to securing AI agent directives.

SignServer delivers centralized signing infrastructure for directive signing. Organizations can sign agent directives through Representational State Transfer (REST) APIs, Public-Key Cryptography Standards #11 (PKCS#11), or Windows Key Storage Provide (KSP) without distributing private keys to individual agents or application teams. A centralized service abstracts key management, reducing the operational complexity of maintaining signing infrastructure across large agent deployments.

Certificate lifecycle management automates the ongoing operational requirements of prompt security: certificate renewal, revocation checking, and CA trust updates. As agent deployments scale, manual certificate management becomes untenable. Automated lifecycle management ensures that cryptographic trust relationships remain current without requiring constant manual intervention.

EJBCA provides enterprise certificate authority infrastructure for issuing and managing the digital certificates that establish agent identities and signing credentials. Each agent receives a unique certificate-backed identity, enabling the mutual authentication and per-agent accountability that multi-agent architectures require.

Policy enforcement shifts authorization decisions from distributed agents to a centralized signing service. Rather than relying on each agent to independently enforce authorization policies, organizations define and enforce policies at the point of directive signing. The signing service issues a valid signature only to directives that pass policy checks.

Hardware security module (HSM) backed key protection ensures that HSMs store signing keys, providing tamper-resistant key storage that meets the compliance requirements of regulated industries.

Together, these capabilities move AI security from heuristic filtering to cryptographic assurance, using the same foundations that protect critical infrastructure worldwide.

Keyfactor aux équipes de sécurité une visibilité et un contrôle sur les identités et la cryptographie qui sécurisent chaque interaction numérique, afin que votre entreprise puisse continuer à fonctionner sans interruption.

Keyfactor gives security teams visibility and control over the identities and cryptography that secure every digital interaction, so your business keeps running—uninterrupted.

Foire aux questions

Got prompt security questions?
We’ve got answers.

S'abonner à La Source

Stay ahead of the curve with Keyfactor’s monthly newsletter — packed with curated insights, expert tips, must-watch videos, and practical guides to help you stay secure, agile, and quantum-ready.

Lire la suite

Graphique futuriste représentant des hexagones bleus connectés, accompagnés d'un cercle HUD lumineux, destiné à la conception d'interfaces utilisateur (UI) ou graphiques (GUI). Cadre abstrait en nid d'abeille cybernétique pour arrière-plan dans le domaine des technologies d'entreprise. Vectoriel
AI

Qu'est-ce qu'une attaque par injection de prompt ? Sécuriser les prompts d'IA grâce à la confiance

En savoir plus
Photo d'illustration représentant un rendu 3D de « Digital Shield ».
AI

What are AI Agents?

En savoir plus
AI

What is Prompt Signing?

En savoir plus