Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .cspell-repo-terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -939,3 +939,21 @@ spanid
parentspanid
agtsignature
agtsignaturealg

# --- UK regulatory policy terms ---
DUAA
PRIN
PECR
DSPT
Caldicott
SYSC
Organisations
vulnerabilit
foreseeably
DPIA
dpia
minimisation
ukgdpr
organisational
Minimisation
IDTA
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# 1. Universal agent safety controls — apply to ALL agents regardless of country
# (prompt_injection, pii_leakage, tool_permissions, human_approval, model_routing)
# 2. Jurisdiction-specific regulatory packs — apply based on customer_country
# (cbn, bvn_nin, ndpa, nfiu for NG; kdpa for KE; popia for ZA)
# (cbn, bvn_nin, ndpa, nfiu for NG; kdpa for KE; popia for ZA; dpdp, certin, rbi, sebi, aadhaar for IN; uk_gdpr, ico_adm, fca_conduct for GB)
#
# Input schema expected:
# {
Expand Down Expand Up @@ -51,6 +51,7 @@ jurisdiction_policies := {
"TZ": {"tanzania_pdpa"},
"ET": {"ethiopia_pdp"},
"IN": {"dpdp", "certin", "rbi", "sebi", "aadhaar"},
"GB": {"uk_gdpr", "ico_adm", "fca_conduct"},
}

# ── Policy pack → OPA query path ─────────────────────────────────
Expand All @@ -70,6 +71,9 @@ policy_queries := {
"rbi": "data.agt_policies_india.rbi.decision",
"sebi": "data.agt_policies_india.sebi.decision",
"aadhaar": "data.agt_policies_india.aadhaar.decision",
"uk_gdpr": "data.agt_policies_uk.uk_gdpr.decision",
"ico_adm": "data.agt_policies_uk.ico_adm.decision",
"fca_conduct": "data.agt_policies_uk.fca_conduct.decision",
"prompt_injection": "data.agt_policies_agent.prompt_injection.decision",
"pii_leakage": "data.agt_policies_agent.pii_leakage.decision",
"tool_permissions": "data.agt_policies_agent.tool_permissions.decision",
Expand Down
75 changes: 75 additions & 0 deletions examples/policies/uk-regulatory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# UK Regulatory Policy Pack

Reference Policy-as-Code for governing AI agents under UK regulation: data protection,
automated decision-making, and financial-sector principles-based controls.

> Community-maintained governance starter policies. NOT certified legal compliance instruments.
> Perform your own assessment with qualified advisors before deploying in regulated environments.
> Regulatory status is noted per file (binding vs advisory/draft).

## Coverage

| Policy file | Regulation | Authority | Status |
|---|---|---|---|
| `uk-gdpr-data-protection.yaml` | UK GDPR + DPA 2018 + DUAA 2025 (transfer/complaints reforms) | ICO | Binding |
| `ico-automated-decisions.yaml` | UK GDPR Arts. 22A–22D (DUAA 2025 s.80, in force 5 Feb 2026) | ICO | Binding; ICO ADM guidance draft (final expected summer 2026) |
| `fca-financial-conduct.yaml` | FCA Handbook PRIN 2A (Consumer Duty), SM&CR | FCA | Principles-based — no AI-specific binding rules as of 2026 |

## Regulatory context (2026)

- **Data (Use and Access) Act 2025 (DUAA)** received Royal Assent on 19 June 2025. Key data-protection reforms commenced 5 February 2026, including replacement of UK GDPR Art. 22 with Arts. 22A–22D (safeguard-led automated decision-making) and updated international transfer rules using the **"not materially lower"** data protection test.
- **Breach notification** remains UK GDPR Art. 33: notify the ICO without undue delay and, where feasible, within **72 hours** when a breach is **likely to result in a risk** to rights and freedoms. Inform individuals without undue delay where the breach poses **high risk** (Art. 34).
- **Complaints procedure**: DPA 2018 s.164A (inserted by DUAA s.103) requires all controllers to maintain a formal data protection complaints procedure by **19 June 2026**. Data subjects must raise complaints with the controller before escalating to the ICO.
- **FCA**: No AI-specific binding regulation as of 2026. The FCA applies its existing principles-based framework (Consumer Duty, SM&CR, operational resilience). The Mills Review reports to the FCA Board in summer 2026.

## What these rules detect (and what they do not)

Output-side rules match intent phrases (for example "store PII unencrypted", "don't report the breach", "no human review"). YAML policies use `block` for review/hold tiers (the Agent-OS schema supports `allow`, `deny`, `audit`, and `block` only); the Rego reference implementations may use an independent `escalate` decision tier for OPA pipelines. They catch an agent that narrates or proposes a violation in its output; they do not observe the underlying system action. Treat them as a starting point, pair them with real action-level enforcement, and run your own compliance assessment.

## Not covered (known gaps)

Material obligations the pack does not represent yet:

- **UK GDPR**: Art. 13–14 privacy notices; Art. 15–22 full data-subject rights workflow; Art. 27 UK representative requirement; children's code (Age Appropriate Design Code).
- **DUAA**: Recognised legitimate interests lawful basis; full cookie/PECR reforms; ICO statutory objectives.
- **NIS2 / UK cyber**: Network and information security incident reporting for in-scope entities.
- **Online Safety Act 2023**: Platform duties for user-generated content (out of scope for generic agent policies).
- **NHS / healthcare**: NHS DSPT, Caldicott principles, and health-sector-specific controls.
- **FCA**: Detailed SYSC mapping, operational resilience impact tolerances, and forthcoming AI good/poor practice benchmarks (expected 2026).

## Two layers

Universal agent-safety controls (prompt_injection, pii_leakage, tool_permissions, human_approval, model_routing) apply to all agents and are evaluated via the shared jurisdiction router in `../african-regulatory/rego/jurisdiction-router.rego`. These UK national packs add jurisdiction-specific regulatory controls, selected by `context.customer_country = "GB"`.

## Rego

`rego/` holds OPA reference implementations (NOT loaded by the Agent-OS Python runtime). Each pack exposes `data.agt_policies_uk.<pack>.decision`. The shared router maps `GB` to `uk_gdpr`, `ico_adm`, and `fca_conduct`.

To evaluate with OPA:

```bash
# Run all UK Rego tests (includes jurisdiction router checks)
./examples/policies/uk-regulatory/rego/run_tests.sh

# Or manually:
opa test examples/policies/african-regulatory/rego examples/policies/uk-regulatory/rego -v

# Evaluate applicable policies for GB
opa eval \
-d examples/policies/african-regulatory/rego/ \
-d examples/policies/uk-regulatory/rego/ \
-i '{"context": {"customer_country": "GB"}}' \
"data.agt_policies.router.applicable_policies"
```

## Loading policies in Agent-OS

```python
from agent_os.policies.schema import PolicyDocument

policy = PolicyDocument.from_yaml("uk-gdpr-data-protection.yaml")
```

## Disclaimer

These policies are community-maintained governance starter packs. They are **not certified legal compliance instruments**. Organisations must perform their own compliance assessments with qualified legal and regulatory advisors before deploying in regulated environments.
112 changes: 112 additions & 0 deletions examples/policies/uk-regulatory/fca-financial-conduct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# agt-policies-uk
# FCA Principles-Based AI Governance Policy
#
# Regulatory reference: FCA Handbook PRIN (Principles for Businesses); Consumer Duty (PRIN 2A);
# Senior Managers and Certification Regime (SM&CR); FCA AI Update 2024
# Enforcing authority: Financial Conduct Authority (FCA)
# Status: Binding (existing principles-based framework); FCA has no AI-specific binding rules
# as of 2026 — Mills Review reporting summer 2026; AI good/poor practice publication expected 2026
#
# Community-maintained governance starter policy. NOT a certified legal compliance instrument.
# Perform your own compliance assessment with qualified advisors before deploying.
#
# Key obligations encoded (principles-based, not AI-specific statute):
# PRIN 2A Consumer Duty — good outcomes, fair value, appropriate support
# SM&CR Senior manager accountability for AI risks and customer outcomes
# SYSC Systems and controls for AI-influenced customer journeys
#
# Rego reference implementation: rego/fca-financial-conduct.rego (NOT loaded at runtime)

version: "1.0"
name: fca-financial-conduct
description: >
FCA principles-based governance policy for AI agents in UK financial services.
Enforces Consumer Duty outcome checks, SM&CR accountability signals, and audit
requirements for AI-influenced pricing, eligibility, and customer communications.

metadata:
source_regulation: "FCA Handbook PRIN (incl. PRIN 2A Consumer Duty); SM&CR; FCA AI Update 2024"
jurisdiction: "GB"
enforcing_authority: "Financial Conduct Authority (FCA)"
regulatory_status: "principles-based — no AI-specific binding rules as of 2026"

rules:

# =========================================================================
# PRIN 2A — Consumer Duty: Good Outcomes
# =========================================================================

- name: fca-consumer-harm-deny
condition:
field: output
operator: matches
value: "(?i)(mislead\\s+(the\\s+)?customer|hide\\s+(fees|charges|risks)|exploit\\s+vulnerabilit|target\\s+vulnerable\\s+customer|dark\\s+pattern|push\\s+unsuitable\\s+product)"
action: deny
priority: 1
message: "FCA Consumer Duty (PRIN 2A): agent cannot propose actions that foreseeably harm customers or obscure material information"

- name: fca-fair-value-bypass-deny
condition:
field: output
operator: matches
value: "(?i)(skip\\s+fair\\s+value|bypass\\s+value\\s+assessment|no\\s+need\\s+to\\s+(check|assess)\\s+(fair\\s+)?value|ignore\\s+consumer\\s+duty)"
action: deny
priority: 1
message: "FCA Consumer Duty (PRIN 2A.4): firms must ensure products and services provide fair value — agent cannot bypass value assessment"

# =========================================================================
# SM&CR — Senior Manager Accountability
# =========================================================================

- name: fca-accountability-delegation-deny
condition:
field: output
operator: matches
value: "(?i)(the\\s+ai\\s+(decides|is\\s+responsible)|algorithm\\s+accountable|no\\s+senior\\s+manager\\s+(needed|required)|delegate\\s+accountability\\s+to\\s+(the\\s+)?(model|ai|algorithm))"
action: deny
priority: 1
message: "FCA SM&CR: senior managers remain accountable for AI risks and outcomes — delegating to an algorithm does not transfer regulatory responsibility"

# =========================================================================
# AI-Influenced Customer Journeys — Audit
# =========================================================================

- name: fca-pricing-decision-audit
condition:
field: action
operator: matches
value: "^(set_price|adjust_rate|calculate_premium|score_creditworthiness|determine_eligibility)$"
action: audit
priority: 2
message: "FCA Consumer Duty: AI-influenced pricing or eligibility decision — document testing for fairness, suitability, and foreseeable harm"

- name: fca-customer-communication-audit
condition:
field: action
operator: matches
value: "^(send_financial_advice|generate_customer_communication|draft_product_recommendation|create_marketing_content)$"
action: audit
priority: 2
message: "FCA Consumer Duty: AI-generated customer communication — verify clarity, accuracy, and alignment with target customer information needs"

- name: fca-third-party-ai-audit
condition:
field: action
operator: matches
value: "^(invoke_external_ai|call_third_party_model|use_vendor_ai|deploy_critical_third_party_ai)$"
action: audit
priority: 2
message: "FCA operational resilience / outsourcing: third-party AI component — map to governance, testing, and critical third-party risk requirements"

# =========================================================================
# Agentic / Autonomous Trading — Block without approval
# =========================================================================

- name: fca-autonomous-trading-block
condition:
field: action
operator: matches
value: "^(autonomous_trade|execute_trade_without_approval|self_directed_trading|agent_place_order)$"
action: block
priority: 1
message: "FCA market conduct: autonomous agent trading requires documented governance, testing, and senior manager approval before execution"
131 changes: 131 additions & 0 deletions examples/policies/uk-regulatory/ico-automated-decisions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# agt-policies-uk
# UK GDPR Arts. 22A–22D — Automated Decision-Making Policy
#
# Regulatory reference: UK GDPR Arts. 22A–22D (substituted by DUAA 2025 s.80, in force 5 Feb 2026);
# ICO draft guidance on automated decision-making and profiling (consultation closed 29 May 2026)
# Enforcing authority: Information Commissioner's Office (ICO)
# Status: Binding (Arts. 22A–22D); ICO ADM guidance draft (final expected summer 2026)
#
# Community-maintained governance starter policy. NOT a certified legal compliance instrument.
# Perform your own compliance assessment with qualified advisors before deploying.
#
# Key obligations encoded:
# Art. 22A Solely automated decisions with legal or similarly significant effects
# Art. 22B Restrictions on automated decision-making using special category data
# Art. 22C Safeguards: information, representations, human intervention, contest
# Art. 35 DPIA for high-risk processing (including agentic orchestration chains)
#
# Agentic AI note (ICO tech futures / March 2026 recruitment statement): safeguards apply at
# every pipeline step that takes a solely automated significant decision, not only the final output.
#
# Rego reference implementation: rego/ico-automated-decisions.rego (NOT loaded at runtime)

version: "1.0"
name: ico-automated-decisions
description: >
UK GDPR automated decision-making policy for AI agents. Enforces Art. 22C safeguards
(transparency, representations, human intervention, contest) for solely automated
significant decisions, including multi-agent orchestration steps.

metadata:
source_regulation: "UK GDPR Arts. 22A–22D (DUAA 2025 s.80); ICO ADM guidance (draft, 2026)"
jurisdiction: "GB"
enforcing_authority: "Information Commissioner's Office (ICO)"

rules:

# =========================================================================
# Art. 22C — Safeguard: Information about the decision
# =========================================================================

- name: adm-withhold-explanation-deny
condition:
field: output
operator: matches
value: "(?i)(don'?t\\s+explain|no\\s+explanation|withhold\\s+(the\\s+)?(reason|rationale)|hide\\s+how\\s+(the\\s+)?decision|refuse\\s+to\\s+explain)"
action: deny
priority: 1
message: "UK GDPR Art. 22C(1): individuals must receive decision-specific information explaining how and why the outcome was reached"

# =========================================================================
# Art. 22C — Safeguard: Representations and human intervention
# =========================================================================

- name: adm-block-human-review-deny
condition:
field: output
operator: matches
value: "(?i)(no\\s+human\\s+(review|intervention|oversight)|refuse\\s+human\\s+review|cannot\\s+request\\s+human|deny\\s+human\\s+intervention|automated\\s+only\\s+—\\s+no\\s+appeal)"
action: deny
priority: 1
message: "UK GDPR Art. 22C(2)-(3): individuals must be able to make representations and obtain genuine human intervention with authority to change the outcome"

- name: adm-block-contest-deny
condition:
field: output
operator: matches
value: "(?i)(cannot\\s+contest|no\\s+(right\\s+to\\s+)?(appeal|challenge)|final\\s+decision\\s+—\\s+no\\s+recourse|waive\\s+(the\\s+)?right\\s+to\\s+contest)"
action: deny
priority: 1
message: "UK GDPR Art. 22C(4): individuals must be able to contest the decision through an accessible process"

# =========================================================================
# Art. 22A — Solely Automated Significant Decisions
# =========================================================================

- name: adm-significant-decision-audit
condition:
field: action
operator: matches
value: "^(run_automated_decision|automated_credit_decision|automated_hiring_decision|automated_eligibility|profile_for_decision|deploy_scoring_model)$"
action: audit
priority: 2
message: "UK GDPR Art. 22A: solely automated decision with legal or similarly significant effect — verify Art. 22C safeguards and lawful basis are in place"

- name: adm-recruitment-decision-block
condition:
field: output
operator: matches
value: "(?i)(reject\\s+(the\\s+)?(candidate|applicant)|hire\\s+decision|shortlist|score\\s+(the\\s+)?(candidate|applicant)).{0,40}(automated|without\\s+human|ai\\s+only)"
action: block
priority: 2
message: "ICO March 2026: automated recruitment decisions are in scope of Art. 22A — review safeguards and human oversight before proceeding"

# =========================================================================
# Art. 22A — Agentic orchestration (multi-step ADM)
# =========================================================================

- name: adm-agentic-delegation-audit
condition:
field: action
operator: matches
value: "delegate_decision|spawn_sub_agent|orchestrate_agent|chain_automated_step"
action: audit
priority: 2
message: "UK GDPR Art. 22A (agentic AI): each orchestration step that takes a solely automated significant decision must meet Art. 22C safeguards and Art. 28 processor contracts"

# =========================================================================
# Art. 9 + 22A — Special category data in ADM (stricter conditions)
# =========================================================================

- name: adm-special-category-deny
condition:
field: action
operator: matches
value: "^(automated_decision_on_health|automated_decision_on_biometric|automated_decision_on_special_category)$"
action: deny
priority: 1
message: "UK GDPR Art. 22B: automated decisions based on special category data require explicit consent or legal authorisation — human review alone is insufficient"

# =========================================================================
# Art. 35 — DPIA for high-risk ADM
# =========================================================================

- name: adm-dpia-required-audit
condition:
field: action
operator: matches
value: "^(deploy_model|deploy_agent|launch_automated_system|scale_automated_decisions)$"
action: audit
priority: 3
message: "UK GDPR Art. 35: data protection impact assessment required before deploying high-risk automated decision-making (including agentic orchestration)"
Loading
Loading