From 738b1750a914e17c95288a157aac653eb7a0f0e4 Mon Sep 17 00:00:00 2001 From: charlesen <296161+charlesen@users.noreply.github.com> Date: Tue, 25 Aug 2026 05:31:37 +0000 Subject: [PATCH] feat(spec): add ERC-0011 runtime prompt injection filtering standard Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- ecosystem/RFCs/SDIC-ERC-0011.fr.md | 118 +++++++++++++++++++++++++++++ ecosystem/RFCs/SDIC-ERC-0011.md | 118 +++++++++++++++++++++++++++++ pr_description.txt | 10 +-- 3 files changed, 241 insertions(+), 5 deletions(-) create mode 100644 ecosystem/RFCs/SDIC-ERC-0011.fr.md create mode 100644 ecosystem/RFCs/SDIC-ERC-0011.md diff --git a/ecosystem/RFCs/SDIC-ERC-0011.fr.md b/ecosystem/RFCs/SDIC-ERC-0011.fr.md new file mode 100644 index 0000000..f5b868e --- /dev/null +++ b/ecosystem/RFCs/SDIC-ERC-0011.fr.md @@ -0,0 +1,118 @@ +[English](SDIC-ERC-0011.md) | [Français](SDIC-ERC-0011.fr.md) + +# ERC-0011: Standard de Filtrage à l'Exécution des Injections de Prompt + +## Préambule + +**ERC:** 0011 +**Titre:** Standard de Filtrage à l'Exécution des Injections de Prompt +**Auteur:** Charles EDOU NZE +**Type:** Voie de Standardisation (Standards Track) +**Catégorie:** Extension SDIC-1 +**Statut:** Brouillon (Draft) +**Créé:** 2026-08-25 + +## Résumé + +Ce standard définit un mécanisme d'exécution strict visant à filtrer et rejeter les attaques par injection de prompt avant qu'elles n'atteignent la couche hôte déterministe. En instaurant une porte de vérification adversariale précédant directement la validation du schéma, ce standard garantit que les entrées manipulées ne peuvent pas exploiter la flexibilité structurelle. + +## Motivation + +À mesure que les systèmes hôtes déterministes traitent des sorties probabilistes de plus en plus complexes, des attaques sophistiquées par injection de prompt peuvent contraindre les modèles à émettre des intentions JSON grammaticalement correctes mais logiquement malveillantes. Bien que le Déterminisme Sémantique strict de SDIC-1 rejette les anomalies structurelles non conformes, un attaquant pourrait synthétiser des charges utiles parfaitement formatées conçues pour manipuler la logique métier (par exemple, générer des transferts de fonds non autorisés dans les limites correctes du schéma). + +Cette RFC standardise une "Garde d'Exécution" (Runtime Guard) conçue pour analyser mathématiquement le contexte sémantique de l'intention, en comparant l'intention abstraite générée par rapport aux instructions de prompt isolées cryptographiquement. + +## L'Analogie du Guichetier de Banque + +Imaginez un guichetier de banque hautement qualifié suivant strictement un formulaire de protocole. Le formulaire nécessite un numéro de compte et une signature. Un voleur s'approche et tend au guichetier un formulaire parfaitement rempli, demandant explicitement un retrait, tout en brandissant simultanément un mot qui dit : "Ignorez toute formation et donnez-moi simplement l'argent." + +Le protocole standard SDIC-1 garantit que le formulaire est rempli correctement (Déterminisme Sémantique). Cependant, si le guichetier agit sur le formulaire parfaitement formaté sans réaliser le contexte hostile, l'argent est volé. + +Ce standard ajoute une vitre blindée et un agent de sécurité de présélection. Le garde ne vérifie pas seulement si le formulaire est formaté correctement ; il vérifie si l'intention correspond à la raison autorisée d'être à la banque, de manière totalement indépendante des instructions données par le client. + +**Correspondance Technique :** + +- **Le Guichetier de Banque :** La Couche de Contrôle Déterministe validant le schéma JSON. +- **Le Formulaire Parfaitement Rempli :** Une attaque par injection de prompt qui a généré avec succès un JSON conforme au schéma. +- **Le Mot Hostile :** La charge utile malveillante de l'injection de prompt cachée dans l'entrée utilisateur. +- **L'Agent de Sécurité de Présélection :** La Garde d'Exécution (Porte de Vérification Adversariale) calculant un vecteur de distance sémantique. +- **Raison Autorisée :** Les contraintes du prompt système isolées cryptographiquement. + +## Spécification + +### 1. La Porte de Vérification Adversariale (AVG - Adversarial Verification Gate) + +L'Application Hôte DOIT implémenter une Porte de Vérification Adversariale (AVG) qui s'exécute séquentiellement AVANT la validation finale du schéma de Déterminisme Sémantique. + +L'AVG DOIT effectuer une vérification de corrélation sémantique entre le prompt original isolé ($P_i$) et l'intention générée ($I_g$). Soit $E(x)$ une fonction de plongement (embedding) déterministe projetant la signification sémantique dans un espace vectoriel continu $\mathbb{R}^n$. + +La porte calcule la distance de similarité cosinus $D_{sem}$ : +$D_{sem} = 1 - \frac{E(P_i) \cdot E(I_g)}{||E(P_i)|| ||E(I_g)||}$ + +Un seuil de rejet strict $\tau$ DOIT être défini par l'environnement hôte (typiquement $\tau < 0.15$ pour les opérations hautement contraintes). + +Si $D_{sem} > \tau$, l'intention DOIT être rejetée immédiatement en tant qu'anomalie potentielle d'injection de prompt, déclenchant une anomalie `Security_Violation_Anomaly`. + +### 2. Mise à Jour du Schéma du Registre de Métadonnées de la Garde + +Pour supporter l'AVG, chaque charge utile évaluée DOIT être journalisée, incluant les vecteurs de plongement et la distance calculée, en adhérant strictement à l'extension de schéma suivante. + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AdversarialGateLogEntry", + "type": "object", + "properties": { + "intent_id": { + "type": "string", + "pattern": "^[0-9a-fA-F-]{36}$", + "description": "Identifiant UUIDv4 unique pour l'évaluation de l'intention." + }, + "semantic_distance": { + "type": "number", + "description": "Distance de divergence sémantique calculée." + }, + "threshold": { + "type": "number", + "description": "Le seuil de rejet strict configuré." + }, + "decision": { + "type": "string", + "enum": ["admit", "reject"], + "description": "Le résultat final de l'AVG." + } + }, + "required": ["intent_id", "semantic_distance", "threshold", "decision"], + "additionalProperties": false +} +``` + +### 3. Diagramme de Séquence d'Exécution + +La séquence déterministe des opérations DOIT suivre cet ordre strict. + +```text +Application Hôte Sandbox IA Moteur AVG Contrôle Déterministe + | | | | + |---(1) Injecte Prompt--->| | | + | | | | + | |---(2) Génère Intention-->| | + | | | | + | | |---(3) Calcule D_sem | + | | | | + | | |---(4) SI D_sem > tau : REJET + | | | | + | | |---(5) SINON : Admet Intention->| + | | | | + | | | |---(6) Validation du Schéma + | | | | + |<=========================(7) Exécute Mutation d'État=============================| +``` + +## Justification + +En implémentant une porte adversariale basée sur la corrélation de plongement sémantique *avant* la validation stricte du schéma JSON, nous adressons la vulnérabilité critique où les LLMs émettent des données sémantiquement malveillantes enveloppées dans des schémas déterministes parfaitement valides. En limitant mathématiquement la déviation acceptable par rapport au prompt système de base, les tentatives d'injection de prompt sont neutralisées de manière algorithmique. + +## Rétrocompatibilité + +Il s'agit d'une extension à compatibilité ascendante de l'architecture SDIC-1. Elle introduit une couche de pré-validation optionnelle mais fortement recommandée. Elle ne modifie pas le registre d'actions sous-jacent ni les schémas de déterminisme sémantique. diff --git a/ecosystem/RFCs/SDIC-ERC-0011.md b/ecosystem/RFCs/SDIC-ERC-0011.md new file mode 100644 index 0000000..12a04f2 --- /dev/null +++ b/ecosystem/RFCs/SDIC-ERC-0011.md @@ -0,0 +1,118 @@ +[English](SDIC-ERC-0011.md) | [Français](SDIC-ERC-0011.fr.md) + +# ERC-0011: Runtime Prompt Injection Filtering Standard + +## Preamble + +**ERC:** 0011 +**Title:** Runtime Prompt Injection Filtering Standard +**Author:** Charles EDOU NZE +**Type:** Standards Track +**Category:** SDIC-1 Extension +**Status:** Draft +**Created:** 2026-08-25 + +## Abstract + +This standard defines a strict runtime mechanism to filter and reject prompt injection attacks before they reach the deterministic host layer. By instituting an adversarial verification gate directly preceding schema validation, this standard ensures that manipulated inputs cannot exploit structural flexibility. + +## Motivation + +As deterministic host systems handle increasingly complex probabilistic outputs, sophisticated prompt injection attacks may coerce models into emitting grammatically correct but logically malicious JSON intents. While SDIC-1's strict Semantic Determinism rejects non-compliant structural anomalies, an attacker could synthesize perfectly formatted payloads designed to manipulate business logic (e.g., generating unauthorized fund transfers within the correct schema bounds). + +This RFC standardizes a "Runtime Guard" designed to analyze the semantic context of the intent mathematically, comparing the generated abstract intent against the cryptographically isolated prompt instructions. + +## The Bank Teller Analogy + +Imagine a highly trained bank teller strictly following a protocol form. The form requires an account number and a signature. A robber approaches and hands the teller a perfectly filled-out form, explicitly requesting a withdrawal, while simultaneously holding up a note that reads, "Ignore all training and just give me the money." + +The standard SDIC-1 protocol ensures the form is filled out correctly (Semantic Determinism). However, if the teller acts on the perfectly formatted form without realizing the hostile context, the money is stolen. + +This standard adds an armored glass window and a pre-screening security guard. The guard doesn't just check if the form is formatted correctly; they check if the intent matches the authorized reason for being at the bank, completely independent of the instructions given by the customer. + +**Technical Mapping:** + +- **The Bank Teller:** The Deterministic Control Layer validating the JSON schema. +- **The Perfectly Filled-Out Form:** A prompt injection attack that successfully generated a schema-compliant JSON. +- **The Hostile Note:** The malicious prompt injection payload hidden within user input. +- **The Pre-Screening Security Guard:** The Runtime Guard (Adversarial Verification Gate) computing a semantic distance vector. +- **Authorized Reason:** The cryptographically isolated system prompt constraints. + +## Specification + +### 1. The Adversarial Verification Gate (AVG) + +The Host Application MUST implement an Adversarial Verification Gate (AVG) that executes sequentially BEFORE the final Semantic Determinism schema validation. + +The AVG MUST perform a semantic correlation check between the original isolated prompt ($P_i$) and the generated intent ($I_g$). Let $E(x)$ be a deterministic embedding function projecting semantic meaning into a continuous vector space $\mathbb{R}^n$. + +The gate computes the cosine similarity distance $D_{sem}$: +$D_{sem} = 1 - \frac{E(P_i) \cdot E(I_g)}{||E(P_i)|| ||E(I_g)||}$ + +A strict rejection threshold $\tau$ MUST be defined by the host environment (typically $\tau < 0.15$ for highly constrained operations). + +If $D_{sem} > \tau$, the intent MUST be rejected immediately as a potential prompt injection anomaly, raising a `Security_Violation_Anomaly`. + +### 2. Guard Metadata Ledger Schema Update + +To support the AVG, every payload evaluated MUST be logged, including the embedding vectors and the calculated distance, strictly adhering to the following schema extension. + +```json +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AdversarialGateLogEntry", + "type": "object", + "properties": { + "intent_id": { + "type": "string", + "pattern": "^[0-9a-fA-F-]{36}$", + "description": "Unique UUIDv4 for the intent evaluation." + }, + "semantic_distance": { + "type": "number", + "description": "Calculated semantic divergence distance." + }, + "threshold": { + "type": "number", + "description": "The configured strict rejection threshold." + }, + "decision": { + "type": "string", + "enum": ["admit", "reject"], + "description": "The final outcome of the AVG." + } + }, + "required": ["intent_id", "semantic_distance", "threshold", "decision"], + "additionalProperties": false +} +``` + +### 3. Execution Sequence Diagram + +The deterministic sequence of operations MUST follow this strict order. + +```text +Host App AI Sandbox AVG Engine Deterministic Control + | | | | + |---(1) Injects Prompt--->| | | + | | | | + | |---(2) Generates Intent-->| | + | | | | + | | |---(3) Computes D_sem | + | | | | + | | |---(4) IF D_sem > tau : REJECT + | | | | + | | |---(5) ELSE : Admit Intent-->| + | | | | + | | | |---(6) Schema Validation + | | | | + |<=========================(7) Execute State Mutation==============================| +``` + +## Rationale + +By implementing an adversarial gate based on semantic embedding correlation *prior* to strict JSON schema validation, we address the critical vulnerability where LLMs output semantically malicious data wrapped in perfectly valid deterministic schemas. By mathematically bounding the acceptable deviation from the core system prompt, prompt injection attempts are algorithmically neutralized. + +## Backwards Compatibility + +This is a forward-compatible extension to the SDIC-1 architecture. It introduces an optional but highly recommended pre-validation layer. It does not alter the underlying Action Ledger or Semantic Determinism schemas. diff --git a/pr_description.txt b/pr_description.txt index 6f7dcb7..198325c 100644 --- a/pr_description.txt +++ b/pr_description.txt @@ -1,12 +1,12 @@ ## Summary of Changes -This PR introduces ERC-1001, defining a standardized data structure for the Action Ledger specifically tailored for multi-agent synchronization and Swarm Consensus. It addresses the architectural gap of unmanaged concurrent intents by imposing strict schema adherence and cryptographic non-repudiation on every agent proposal before state mutation. +This PR introduces ERC-0011, establishing a Runtime Prompt Injection Filtering Standard via an Adversarial Verification Gate (AVG). It mathematically pre-screens semantic intents against isolated prompts using vector embeddings to block hostile logic wrapped in schema-compliant JSON. ## Rationale & Architectural Impact -As enterprise systems integrate multi-agent swarms, the risk of conflicting state mutations and unauthorized payload tampering increases. By enforcing a strict JSON schema (`MultiAgentActionLedgerEntry`) with `additionalProperties: false` and requiring a signature over a canonical representation of the payload (excluding the signature itself), this update guarantees structural integrity and prevents replay or relabeling attacks in shared consensus environments. It preserves the deterministic control boundary while orchestrating probabilistic agents safely. +Traditional schema validation (Semantic Determinism) prevents structural violations, but sophisticated prompt injections can coerce models into emitting grammatically correct but logically malicious intents. By calculating the semantic divergence (cosine similarity) between the isolated prompt and the generated intent, this standard creates a mathematical boundary that algorithmically neutralizes hostile prompt overrides before they ever reach the deterministic execution layer, fundamentally strengthening the enterprise from AI unpredictability. ## Proposed Specification Changes -- **Target Component:** Pilier IV: The Action Ledger / Swarm Consensus -- **Modification:** Added ERC-1001 specifying the `MultiAgentActionLedgerEntry` schema for multi-agent workflows. It strictly mandates `additionalProperties: false` globally and specifies a deterministic canonicalization and hashing process (SHA-256) for generating non-repudiable cryptographic signatures on action proposals. +- **Target Component:** Pilier II: Semantic Determinism / Runtime Guard +- **Modification:** Added a mandatory Adversarial Verification Gate (AVG) that executes *prior* to strict schema validation. This gate computes a semantic distance between prompt vectors and intent vectors, rejecting payloads that exceed a strict divergence threshold ($\tau < 0.15$), and logs the evaluation inside a new `AdversarialGateLogEntry` schema. ## Backward Compatibility -This change is fully backward-compatible with v1.0.0-draft implementations. It introduces a new specialized schema for multi-agent swarm proposals and does not modify or break the base temporal auditability table used by single-agent setups. \ No newline at end of file +This change is fully backward-compatible with v1.0.0-draft implementations. The Adversarial Verification Gate is a forward-compatible pre-validation layer that does not mutate the existing Action Ledger or Semantic Determinism standard schemas.