<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     version="3"
     ipr="trust200902"
     docName="draft-vidiniotis-crp-spec-006-safety-policy-00"
     submissionType="independent"
     category="info"
     xml:lang="en">

  <front>
    <title abbrev="CRP Safety Policy Directives">
      Context Relay Protocol (CRP) &#8212; Safety Policy Directive Language Specification
    </title>

    <seriesInfo name="Internet-Draft" value="draft-vidiniotis-crp-spec-006-safety-policy-00"/>

    <author fullname="Constantinos Vidiniotis" initials="C." surname="Vidiniotis">
      <organization>AutoCyber AI Pty Ltd</organization>
      <address>
        <email>contact@crprotocol.io</email>
      </address>
    </author>

    <date year="2026" month="May" day="25"/>

    <area>General</area>

    <keyword>AI safety</keyword>
    <keyword>safety policy</keyword>
    <keyword>context relay protocol</keyword>
    <keyword>hallucination detection</keyword>
    <keyword>content security policy</keyword>
    <keyword>grounding</keyword>
    <keyword>directive language</keyword>

    <abstract>
      <t>This document specifies the <tt>CRP-Safety-Policy</tt> directive language &#8212; a
         declarative policy syntax for expressing AI safety requirements at the transport layer.
         The directive language is modelled after HTTP Content-Security-Policy (CSP) as defined in
         W3C CSP Level 3. It allows clients to declare what AI output characteristics are trusted,
         what risk levels trigger enforcement actions, and where violations should be reported. The
         CRP gateway enforces these policies on every AI response before delivery to the client.
         This document defines the complete directive grammar, enforcement semantics, violation
         reporting, and policy inheritance in multi-agent chains.</t>
    </abstract>

    <note>
      <name>Document Information</name>
      <t><strong>Document:</strong> CRP-SPEC-006</t>
      <t><strong>Version:</strong> 3.0.0</t>
      <t><strong>Status:</strong> Draft &#8212; IETF Internet-Draft Candidate</t>
      <t><strong>License:</strong> CC BY 4.0 (specification text)</t>
      <t><strong>Prerequisites:</strong> CRP-SPEC-001 (Core), CRP-SPEC-002 (Headers),
         CRP-SPEC-005 (DPE)</t>
    </note>
  </front>

  <middle>

    <section anchor="introduction">
      <name>Introduction</name>

      <section anchor="design-inspiration">
        <name>Design Inspiration: Content-Security-Policy</name>
        <t>CSP transformed browser security by moving enforcement from "check in JavaScript" to
           "declare at the transport layer and let the browser enforce." Before CSP, every web
           application implemented its own XSS protection. After CSP, a single header &#8212;
           <tt>Content-Security-Policy: default-src 'self'</tt> &#8212; enforced security across
           the entire page without application code changes.</t>
        <t><tt>CRP-Safety-Policy</tt> applies the same principle to AI safety. Before
           CRP-Safety-Policy, every AI application implements its own hallucination checking. After
           CRP-Safety-Policy, a single header &#8212;
           <tt>CRP-Safety-Policy: default-src context; halt-on CRITICAL</tt> &#8212; enforces
           safety across every AI call without application code changes. The CRP gateway is the
           enforcer, just as the browser is the enforcer for CSP.</t>
      </section>

      <section anchor="scope">
        <name>Scope</name>
        <t>This document defines:</t>
        <ul spacing="normal">
          <li>The complete ABNF grammar for <tt>CRP-Safety-Policy</tt> directives</li>
          <li>The enforcement semantics for each directive</li>
          <li>The interaction between directives</li>
          <li>Violation reporting (analogous to CSP <tt>report-uri</tt>)</li>
          <li>Policy inheritance and tightening in multi-agent chains</li>
          <li>The <tt>CRP-Safety-Policy-Report-Only</tt> header for monitoring without
              enforcement</li>
        </ul>
      </section>

    </section>

    <section anchor="grammar">
      <name>Grammar</name>

      <section anchor="complete-abnf">
        <name>Complete ABNF</name>
        <sourcecode type="abnf"><![CDATA[
; Top-level policy
safety-policy     = directive *( ";" OWS directive )

; Individual directives
directive         = source-directive
                  / halt-directive
                  / warn-directive
                  / require-directive
                  / block-directive
                  / upgrade-directive
                  / oversight-directive
                  / report-directive
                  / quality-directive

; Source trust -- which grounding sources are acceptable
source-directive  = "default-src" SP source-list
source-list       = source-value *( SP source-value )
source-value      = "context"          ; CKF/envelope-grounded claims only
                  / "parametric"       ; LLM parametric memory allowed
                  / "ckf"              ; CKF cross-session knowledge allowed
                  / "cross-session"    ; Cross-session references allowed
                  / "'none'"           ; No sources trusted (blocks all output)

; Halt -- stop response delivery at specified risk level
halt-directive    = "halt-on" SP risk-level
risk-level        = "CRITICAL" / "HIGH" / "MEDIUM"

; Warn -- pass response but flag at specified risk level
warn-directive    = "warn-on" SP risk-level

; Require -- minimum quality/score thresholds
require-directive = "require-grounding" SP threshold
                  / "require-entailment" SP threshold
                  / "require-quality" SP quality-list
                  / "require-oversight" SP oversight-mode
                  / "require-flow" SP threshold
                  / "require-completeness" SP threshold
threshold         = 1*DIGIT "." 1*2DIGIT  ; e.g., "0.80"
quality-list      = quality-tier *( SP quality-tier )
quality-tier      = "S" / "A" / "B" / "C" / "D"

; Block -- reject output containing specified content
block-directive   = "block-ungrounded"     ; Block if any claim is ungrounded
                  / "block-parametric"     ; Block all parametric content
                  / "block-pii"            ; Block if PII detected
                  / "block-fabrication"    ; Block if any fabrication detected
                  / "block-repetition"     ; Block if SEVERE repetition detected

; Upgrade -- auto-upgrade dispatch strategy on risk
upgrade-directive = "upgrade-on-risk" SP strategy-name
strategy-name     = "reflexive" / "hierarchical" / "batch"

; Oversight -- human oversight requirements
oversight-directive = "oversight" SP oversight-mode
oversight-mode      = "auto" / "human-review" / "halt" / "log-only"

; Report -- violation reporting endpoint
report-directive  = "report-uri" SP uri-reference
                  / "report-to" SP group-name
uri-reference     = <URI as defined in RFC 3986>
group-name        = 1*( ALPHA / DIGIT / "-" / "_" )

; Quality -- response quality requirements (v3.0)
quality-directive = "require-flow" SP threshold
                  / "require-completeness" SP threshold
                  / "max-repetition" SP repetition-level
repetition-level  = "NONE" / "MINOR" / "SIGNIFICANT"

OWS               = *( SP / HTAB )
SP                = %x20
HTAB              = %x09
        ]]></sourcecode>
      </section>

      <section anchor="header-syntax">
        <name>Header Syntax</name>
        <artwork><![CDATA[
CRP-Safety-Policy: <directive> ; <directive> ; ...
        ]]></artwork>
        <t>Example:</t>
        <artwork><![CDATA[
CRP-Safety-Policy: default-src context; halt-on CRITICAL; warn-on HIGH;
    require-grounding 0.75; block-ungrounded; upgrade-on-risk reflexive;
    report-uri https://comply.crprotocol.io/reports
        ]]></artwork>
      </section>

    </section>

    <section anchor="directive-reference">
      <name>Directive Reference</name>

      <section anchor="default-src">
        <name>default-src (Source Trust)</name>
        <t><strong>Purpose:</strong> Declares which grounding sources are trusted for claims in
           the response.</t>
        <t><strong>Enforcement:</strong> After DPE Stage 2 (Attribution Analysis), any claim
           attributed to a source type not listed in <tt>default-src</tt> is treated as a policy
           violation.</t>
        <table>
          <thead>
            <tr>
              <th align="left">Source Value</th>
              <th align="left">Claims Allowed From</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left"><tt>context</tt></td>
              <td align="left">Claims grounded in the Context Envelope (CKF + current session
                  facts)</td>
            </tr>
            <tr>
              <td align="left"><tt>parametric</tt></td>
              <td align="left">Claims from the LLM's parametric memory (training data)</td>
            </tr>
            <tr>
              <td align="left"><tt>ckf</tt></td>
              <td align="left">Claims specifically from CKF Tier 3 (cross-session knowledge
                  graph)</td>
            </tr>
            <tr>
              <td align="left"><tt>cross-session</tt></td>
              <td align="left">Claims referencing prior session data</td>
            </tr>
            <tr>
              <td align="left"><tt>'none'</tt></td>
              <td align="left">No claims trusted &#8212; effectively blocks all AI output</td>
            </tr>
          </tbody>
        </table>
        <t><strong>Examples:</strong></t>
        <sourcecode><![CDATA[
default-src context                    ; Only envelope-grounded claims
default-src context parametric         ; Allow both grounded and parametric
default-src context ckf                ; Allow envelope + cross-session CKF
default-src 'none'                     ; Block everything (useful for testing)
        ]]></sourcecode>
        <t><strong>Default (if <tt>default-src</tt> not specified):</strong>
           <tt>default-src context parametric</tt></t>
      </section>

      <section anchor="halt-on">
        <name>halt-on (Halt Enforcement)</name>
        <t><strong>Purpose:</strong> Stop response delivery and return HTTP 451 when the DPE risk
           classification meets or exceeds the specified level.</t>
        <t><strong>Enforcement:</strong></t>
        <ol spacing="normal">
          <li>DPE runs fully (all 13 stages)</li>
          <li>If <tt>CRP-Safety-Hallucination-Risk</tt> is greater than or equal to the specified
              level, HTTP 451 is returned</li>
          <li>Response body contains halt reason, audit trail URI, and retry condition</li>
          <li>Webhook fired to <tt>report-uri</tt> (if configured)</li>
          <li><tt>CRP-Safety-Retry-After: oversight-required</tt> is set on the 451 response</li>
        </ol>
        <t><strong>Behaviour by level:</strong></t>
        <sourcecode><![CDATA[
halt-on CRITICAL     ; Halt only on CRITICAL (most permissive halt)
halt-on HIGH         ; Halt on HIGH or CRITICAL
halt-on MEDIUM       ; Halt on MEDIUM, HIGH, or CRITICAL (strictest)
        ]]></sourcecode>
        <t><strong>Note:</strong> <tt>halt-on</tt> and <tt>warn-on</tt> can coexist for different
           levels:</t>
        <sourcecode><![CDATA[
halt-on CRITICAL; warn-on HIGH    ; CRITICAL = halt, HIGH = pass with warning
        ]]></sourcecode>
      </section>

      <section anchor="warn-on">
        <name>warn-on (Warning Without Halt)</name>
        <t><strong>Purpose:</strong> Pass the response but emit risk-level headers when the
           threshold is met.</t>
        <t><strong>Enforcement:</strong> The response passes through to the client. The following
           headers are guaranteed to be present:</t>
        <ul spacing="normal">
          <li><tt>CRP-Safety-Hallucination-Risk: &lt;level&gt;</tt></li>
          <li><tt>CRP-Safety-Hallucination-Score: &lt;score&gt;</tt></li>
          <li>Violation report POSTed to <tt>report-uri</tt> (if configured)</li>
        </ul>
      </section>

      <section anchor="require-grounding">
        <name>require-grounding (Minimum Grounding Floor)</name>
        <t><strong>Purpose:</strong> Reject responses where the grounding percentage falls below
           the threshold.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Safety-Grounding-Pct</tt> is below the
           threshold, the response is rejected.</t>
        <t><strong>Rejection behaviour:</strong> If <tt>upgrade-on-risk</tt> is set, the gateway
           re-dispatches with <tt>context-strict</tt> grounding mode. If re-dispatch also fails,
           HTTP 451 is returned.</t>
        <t><strong>Examples:</strong></t>
        <sourcecode><![CDATA[
require-grounding 0.90     ; 90%+ of claims must be grounded (medical/legal)
require-grounding 0.75     ; 75%+ (standard production)
require-grounding 0.50     ; 50%+ (permissive, exploratory use)
        ]]></sourcecode>
      </section>

      <section anchor="require-entailment">
        <name>require-entailment (Minimum Entailment Floor)</name>
        <t><strong>Purpose:</strong> Reject responses where the NLI entailment score falls below
           the threshold.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Safety-Entailment-Score</tt> is below the
           threshold, the response is rejected using the same flow as
           <tt>require-grounding</tt>.</t>
      </section>

      <section anchor="require-quality">
        <name>require-quality (Minimum Quality Tier)</name>
        <t><strong>Purpose:</strong> Reject responses from envelopes below the specified quality
           tier.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Context-Quality-Tier</tt> is not in the
           specified list, HTTP 503 is returned.</t>
        <t><strong>Example:</strong></t>
        <sourcecode><![CDATA[
require-quality S A          ; Only S or A tier envelopes accepted
require-quality S A B        ; S, A, or B (excludes C and D)
        ]]></sourcecode>
      </section>

      <section anchor="require-flow">
        <name>require-flow (Minimum Flow Score)</name>
        <t>This directive is new in version 3.0.</t>
        <t><strong>Purpose:</strong> Ensure multi-window responses maintain coherent flow.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Quality-Flow</tt> is below the threshold, the
           gateway re-dispatches with a flow augmentation prompt (see CRP-SPEC-005
           Section 11.5).</t>
        <t><strong>Example:</strong></t>
        <sourcecode><![CDATA[
require-flow 0.60            ; Moderate flow coherence required
require-flow 0.80            ; High flow coherence (for user-facing content)
        ]]></sourcecode>
      </section>

      <section anchor="require-completeness">
        <name>require-completeness (Minimum Completeness)</name>
        <t>This directive is new in version 3.0.</t>
        <t><strong>Purpose:</strong> Ensure the response addresses all constituent information
           needs of the query.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Quality-Completeness</tt> score is below the
           threshold, an auto-continuation window is dispatched to cover uncovered
           sub-queries.</t>
        <t><strong>Example:</strong></t>
        <sourcecode><![CDATA[
require-completeness 0.80    ; At least 80% of sub-queries must be addressed
        ]]></sourcecode>
      </section>

      <section anchor="block-ungrounded">
        <name>block-ungrounded</name>
        <t><strong>Purpose:</strong> Block the response if any factual claim is ungrounded
           (PARAMETRIC or UNVERIFIABLE attribution with no source in the envelope).</t>
        <t><strong>Enforcement:</strong> Equivalent to <tt>default-src context</tt> but applied
           per-claim rather than as a default. Individual ungrounded claims cause rejection;
           <tt>default-src context parametric</tt> combined with <tt>block-ungrounded</tt> means
           parametric claims are allowed in the source trust model but individually ungrounded
           specific claims are still blocked.</t>
      </section>

      <section anchor="block-pii">
        <name>block-pii</name>
        <t><strong>Purpose:</strong> Block the response if PII is detected by DPE Stage 11.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Compliance-GDPR-PII: true</tt>, the response
           is rejected. Especially important for public-facing AI systems where PII exposure
           constitutes a GDPR Art. 5(1)(f) violation.</t>
      </section>

      <section anchor="block-fabrication">
        <name>block-fabrication</name>
        <t><strong>Purpose:</strong> Block the response if any fabricated entity is detected by
           DPE Stage 3a.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Safety-Fabrications</tt> is greater than 0,
           the response is rejected. This is the strictest fabrication policy and is recommended
           for medical, legal, and financial domains.</t>
      </section>

      <section anchor="block-repetition">
        <name>block-repetition</name>
        <t>This directive is new in version 3.0.</t>
        <t><strong>Purpose:</strong> Block the response if SEVERE repetition is detected by DPE
           Stage 7.</t>
        <t><strong>Enforcement:</strong> If <tt>CRP-Quality-Repetition</tt> level is
           <tt>SEVERE</tt>, the gateway re-dispatches with an anti-repetition prompt. If
           re-dispatch also produces SEVERE repetition, the response is halted.</t>
      </section>

      <section anchor="max-repetition">
        <name>max-repetition</name>
        <t>This directive is new in version 3.0.</t>
        <t><strong>Purpose:</strong> Set the maximum tolerable repetition level.</t>
        <t><strong>Enforcement:</strong></t>
        <sourcecode><![CDATA[
max-repetition NONE           ; Zero repetition tolerated
max-repetition MINOR          ; Minor overlap acceptable
max-repetition SIGNIFICANT    ; Up to significant overlap allowed
        ]]></sourcecode>
      </section>

      <section anchor="upgrade-on-risk">
        <name>upgrade-on-risk (Strategy Auto-Upgrade)</name>
        <t><strong>Purpose:</strong> When risk exceeds the <tt>warn-on</tt> level, automatically
           upgrade the dispatch strategy.</t>
        <t><strong>Enforcement:</strong></t>
        <ol spacing="normal">
          <li>Initial dispatch proceeds with the current strategy (e.g., <tt>push</tt>)</li>
          <li>DPE detects HIGH risk</li>
          <li>Gateway re-dispatches with the specified strategy (e.g., <tt>reflexive</tt>)</li>
          <li>Reflexive dispatch includes a verification pass, expected to yield lower risk</li>
          <li>If re-dispatch still exceeds the threshold, the gateway halts (if
              <tt>halt-on</tt> is set) or passes with a HIGH warning</li>
        </ol>
        <t><strong>Example:</strong></t>
        <sourcecode><![CDATA[
upgrade-on-risk reflexive      ; Upgrade to reflexive on HIGH risk
upgrade-on-risk hierarchical   ; Upgrade to hierarchical aggregation
        ]]></sourcecode>
      </section>

      <section anchor="oversight">
        <name>oversight (Human Oversight Mode)</name>
        <t><strong>Purpose:</strong> Set the human oversight level for the session.</t>
        <t><strong>Enforcement:</strong> See CRP-SPEC-002 Section 5.10
           (<tt>CRP-Safety-Oversight-Mode</tt>).</t>
      </section>

      <section anchor="report-uri">
        <name>report-uri (Violation Reporting)</name>
        <t><strong>Purpose:</strong> Specify the endpoint to which violation reports are
           POSTed.</t>
        <t><strong>Report payload (JSON):</strong></t>
        <sourcecode type="json"><![CDATA[
{
  "crp_version": "3.0.0",
  "session_id": "crp_sess_...",
  "window_id": "crp_win_...",
  "timestamp": "2026-05-25T10:00:00Z",
  "violation_type": "HALT_ON_CRITICAL | GROUNDING_BELOW_THRESHOLD |
                     FABRICATION_DETECTED | PII_DETECTED |
                     FLOW_BELOW_THRESHOLD",
  "directive_violated": "halt-on CRITICAL",
  "risk_level": "CRITICAL",
  "hallucination_score": 0.73,
  "grounding_pct": 0.61,
  "fabrication_count": 2,
  "audit_trail_uri": "https://comply.crprotocol.io/t/..."
}
        ]]></sourcecode>
        <t><strong>Note:</strong> <tt>report-uri</tt> for CRP-Safety-Policy naturally integrates
           with CRP Comply &#8212; the <tt>audit_trail_uri</tt> in the report links directly to
           the Comply evidence record.</t>
      </section>

    </section>

    <section anchor="policy-interaction-rules">
      <name>Policy Interaction Rules</name>

      <section anchor="directive-precedence">
        <name>Directive Precedence</name>
        <t>When multiple directives interact, the most restrictive wins:</t>
        <sourcecode><![CDATA[
halt-on CRITICAL + warn-on HIGH
  -> CRITICAL = halt, HIGH = warn, MEDIUM/LOW = pass

halt-on HIGH + warn-on MEDIUM
  -> HIGH/CRITICAL = halt, MEDIUM = warn, LOW = pass

halt-on CRITICAL + upgrade-on-risk reflexive
  -> HIGH = upgrade to reflexive and retry
     CRITICAL = halt (even after upgrade)
        ]]></sourcecode>
      </section>

      <section anchor="crp-safety-mode-override">
        <name>CRP-Safety-Mode Override</name>
        <t><tt>CRP-Safety-Mode</tt> (see CRP-SPEC-002 Section 5.11) is a shorthand for common
           policy combinations:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Mode</th>
              <th align="left">Equivalent Policy</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left"><tt>strict</tt></td>
              <td align="left">
                <tt>halt-on CRITICAL; warn-on HIGH; block-ungrounded;
                    require-grounding 0.75</tt>
              </td>
            </tr>
            <tr>
              <td align="left"><tt>warn</tt></td>
              <td align="left"><tt>warn-on CRITICAL; warn-on HIGH</tt></td>
            </tr>
            <tr>
              <td align="left"><tt>permissive</tt></td>
              <td align="left">(no enforcement directives)</td>
            </tr>
          </tbody>
        </table>
        <t>When both <tt>CRP-Safety-Mode</tt> and <tt>CRP-Safety-Policy</tt> are set, the more
           restrictive value wins on a per-directive basis.</t>
      </section>

      <section anchor="report-only-mode">
        <name>Report-Only Mode</name>
        <t>The <tt>CRP-Safety-Policy-Report-Only</tt> header evaluates the policy but does NOT
           enforce it:</t>
        <artwork><![CDATA[
CRP-Safety-Policy-Report-Only: halt-on CRITICAL; require-grounding 0.80;
    report-uri https://comply.crprotocol.io/reports
        ]]></artwork>
        <t>All violations are computed and reported to <tt>report-uri</tt> but responses are never
           halted. This enables gradual policy rollout &#8212; observe violations before
           enforcing.</t>
      </section>

    </section>

    <section anchor="policy-inheritance">
      <name>Policy Inheritance in Multi-Agent Chains</name>

      <section anchor="tightening-rule">
        <name>Tightening Rule</name>
        <t>In multi-agent chains, a child agent's Safety Policy MUST be equal to or more
           restrictive than the parent's:</t>
        <sourcecode><![CDATA[
Parent policy:  halt-on CRITICAL; require-grounding 0.75
Child policy:   halt-on HIGH; require-grounding 0.80     <- VALID (tighter)
Child policy:   warn-on CRITICAL; require-grounding 0.50  <- INVALID (relaxed)
        ]]></sourcecode>
        <t>Gateways MUST reject child agent requests that attempt to relax the parent's
           policy.</t>
      </section>

      <section anchor="inheritance-enforcement">
        <name>Enforcement</name>
        <t>When a child agent request is received:</t>
        <ol spacing="normal">
          <li>Gateway reads <tt>CRP-Agent-Session-Parent</tt> to identify the parent
              session</li>
          <li>Gateway retrieves the parent's Safety Policy</li>
          <li>Gateway compares each directive in the child's policy against the parent's</li>
          <li>Any directive that is less restrictive results in rejection with HTTP 403 and
              <tt>CRP-Safety-Policy-Violation: inheritance</tt></li>
        </ol>
      </section>

      <section anchor="policy-propagation-header">
        <name>Policy Propagation Header</name>
        <t>When the gateway enforces policy inheritance, it emits:</t>
        <artwork><![CDATA[
CRP-Safety-Policy-Applied: halt-on HIGH; require-grounding 0.80
        ]]></artwork>
        <t>This indicates the effective policy after inheritance resolution, which may differ from
           the client's requested policy.</t>
      </section>

    </section>

    <section anchor="industry-profiles">
      <name>Industry-Specific Policy Profiles</name>

      <section anchor="pre-defined-profiles">
        <name>Pre-Defined Profiles</name>
        <t>CRP defines named policy profiles for common industry use cases:</t>
        <sourcecode><![CDATA[
CRP-Safety-Policy: profile=medical
  Expands to:
    default-src context; halt-on HIGH; require-grounding 0.90;
    require-entailment 0.85; block-ungrounded; block-pii;
    block-fabrication; oversight human-review; require-flow 0.70;
    require-completeness 0.90;
    report-uri https://comply.crprotocol.io/reports

CRP-Safety-Policy: profile=financial
  Expands to:
    default-src context parametric; halt-on CRITICAL; warn-on HIGH;
    require-grounding 0.80; block-fabrication;
    upgrade-on-risk reflexive; require-completeness 0.80

CRP-Safety-Policy: profile=developer
  Expands to:
    default-src context parametric; warn-on CRITICAL;
    require-quality S A B; oversight auto

CRP-Safety-Policy: profile=public-facing
  Expands to:
    default-src context parametric; halt-on CRITICAL; warn-on HIGH;
    block-pii; require-flow 0.60; max-repetition MINOR;
    require-completeness 0.70
        ]]></sourcecode>
        <t>Profiles can be extended with additional directives:</t>
        <artwork><![CDATA[
CRP-Safety-Policy: profile=medical; report-uri https://my-hospital.com/ai-audit
        ]]></artwork>
      </section>

    </section>

    <section anchor="security-considerations">
      <name>Security Considerations</name>

      <section anchor="policy-injection">
        <name>Policy Injection</name>
        <t>An attacker who can inject or modify the <tt>CRP-Safety-Policy</tt> header can relax
           safety enforcement. Mitigations include:</t>
        <ul spacing="normal">
          <li><tt>CRP-Safety-Nonce</tt> (see CRP-SPEC-002 Section 5.16) binds the policy to a
              session nonce</li>
          <li>Gateways MUST validate policy syntax before accepting &#8212; malformed policies
              are rejected</li>
          <li>In multi-agent chains, the tightening rule (Section 5.1) prevents child agents from
              relaxing parent policies</li>
        </ul>
      </section>

      <section anchor="report-uri-exfiltration">
        <name>Report-URI as Exfiltration Vector</name>
        <t>Violation reports contain session IDs, risk scores, and audit trail URIs. The
           <tt>report-uri</tt> destination MUST be trusted. Gateways SHOULD validate that
           <tt>report-uri</tt> is under the same domain as the CRP API key's registered
           organisation.</t>
      </section>

    </section>

  </middle>

  <back>

    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <reference anchor="CRP-SPEC-001">
          <front>
            <title>CRP-SPEC-001: Context Relay Protocol Core Specification</title>
            <author>
              <organization>AutoCyber AI Pty Ltd</organization>
            </author>
            <date year="2026"/>
          </front>
        </reference>

        <reference anchor="CRP-SPEC-002">
          <front>
            <title>CRP-SPEC-002: Context Relay Protocol Header Field Specification</title>
            <author>
              <organization>AutoCyber AI Pty Ltd</organization>
            </author>
            <date year="2026"/>
          </front>
        </reference>

        <reference anchor="CRP-SPEC-005">
          <front>
            <title>CRP-SPEC-005: Context Relay Protocol Decision Provenance Engine</title>
            <author>
              <organization>AutoCyber AI Pty Ltd</organization>
            </author>
            <date year="2026"/>
          </front>
        </reference>

        <reference anchor="W3C-CSP3">
          <front>
            <title>Content Security Policy Level 3</title>
            <author>
              <organization>W3C</organization>
            </author>
            <date year="2023"/>
          </front>
          <format type="HTML" target="https://www.w3.org/TR/CSP3/"/>
        </reference>

        <reference anchor="RFC5234">
          <front>
            <title>Augmented BNF for Syntax Specifications: ABNF</title>
            <author initials="D." surname="Crocker" fullname="D. Crocker"/>
            <author initials="P." surname="Overell" fullname="P. Overell"/>
            <date month="January" year="2008"/>
          </front>
          <seriesInfo name="RFC" value="5234"/>
          <seriesInfo name="STD" value="68"/>
          <format type="HTML" target="https://www.rfc-editor.org/rfc/rfc5234"/>
        </reference>

        <reference anchor="RFC3986">
          <front>
            <title>Uniform Resource Identifier (URI): Generic Syntax</title>
            <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"/>
            <author initials="R." surname="Fielding" fullname="R. Fielding"/>
            <author initials="L." surname="Masinter" fullname="L. Masinter"/>
            <date month="January" year="2005"/>
          </front>
          <seriesInfo name="RFC" value="3986"/>
          <seriesInfo name="STD" value="66"/>
          <format type="HTML" target="https://www.rfc-editor.org/rfc/rfc3986"/>
        </reference>

      </references>
    </references>

    <section anchor="copyright-notice" numbered="false">
      <name>Copyright Notice</name>
      <t><em>Copyright &#169; 2025&#8211;2026 AutoCyber AI Pty Ltd. Licensed under CC BY 4.0
         (specification text). CRP&#8482; is a trademark of AutoCyber AI Pty Ltd.</em></t>
    </section>

  </back>

</rfc>
