Skip to content

feat(examples): add UK regulatory policy pack (UK GDPR, ICO ADM, FCA)#3254

Open
dannyyol wants to merge 13 commits into
microsoft:mainfrom
dannyyol:feat/uk-regulatory-policy-pack
Open

feat(examples): add UK regulatory policy pack (UK GDPR, ICO ADM, FCA)#3254
dannyyol wants to merge 13 commits into
microsoft:mainfrom
dannyyol:feat/uk-regulatory-policy-pack

Conversation

@dannyyol

@dannyyol dannyyol commented Jul 4, 2026

Copy link
Copy Markdown

Description

Adds a UK regulatory policy pack to examples/policies/uk-regulatory/, following the same pattern established by the African regulatory pack (#3077) and India regulatory pack (#3123).

The UK is a major regulated AI-agent market (financial services, public sector, healthcare) and had no jurisdiction-specific coverage in AGT yet. This PR adds starter Policy-as-Code examples that govern what an AI agent is allowed to do under UK law, evaluated at the agent action/output boundary with allow, audit, escalate, or deny decisions and statutory citations on each rule.

Three policy files

File Coverage Authority
uk-gdpr-data-protection.yaml UK GDPR + DPA 2018 — breach notification when likely to pose risk (72h to ICO; Art. 34 if high risk), security safeguards, purpose limitation, special category data, restricted transfers (escalate for review; deny without adequacy/safeguards; DUAA "not materially lower" test), complaints procedure (DPA 2018 s.164A) ICO
ico-automated-decisions.yaml UK GDPR Arts. 22A–22D (DUAA 2025 s.80) — Art. 22C safeguards, Art. 22B special-category ADM, agentic orchestration steps, recruitment ADM ICO
fca-financial-conduct.yaml Consumer Duty (PRIN 2A), SM&CR accountability, AI-influenced pricing/communications (principles-based — no AI-specific binding rules as of 2026) FCA

Also included

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Maintenance (dependency updates, CI/CD, refactoring)
  • Security fix

Package(s) Affected

  • agent-os-kernel
  • agent-mesh
  • agent-runtime
  • agent-sre
  • agent-governance
  • docs / root

Checklist

  • My code follows the project style guidelines (matches the existing regulatory-pack format)
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass (opa test — 41/41 pass via rego/run_tests.sh)
  • I have updated documentation as needed
  • I have signed the Microsoft CLA

Test plan

  • Run ./examples/policies/uk-regulatory/rego/run_tests.sh — expect 41/41 PASS
  • Validate YAML policies (from repo root with agent-governance-python installed):
    python -m agent_os.policies.cli validate examples/policies/uk-regulatory/*.yaml
    
    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"
    

dannyyol added 6 commits July 4, 2026 11:21
Add governance starter policies for GB jurisdiction covering UK GDPR/DPA 2018,
DUAA 2025 automated decision-making safeguards, and FCA principles-based
financial conduct, with OPA Rego references and jurisdiction router wiring.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Add 38 Rego unit tests covering UK GDPR, ICO ADM, FCA conduct, and GB
jurisdiction routing, plus a run_tests.sh runner and README instructions.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Keep upstream README structure (Using this directory, Policy format, Related)
and add a Policy Packs table row for uk-regulatory without replacing
existing documentation.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Restore examples/policies/README.md to match upstream main; policy pack
catalog updates are handled elsewhere.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Add GB pack mappings without removing upstream IN entries (dpdp, certin, rbi,
sebi, aadhaar). Add regression test to keep India routing intact.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Refine breach-notification messaging, escalate cross-border transfers
instead of blanket blocking, correct Art. 22B special-category ADM
requirements, and sync YAML with Rego reference implementations.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: security-scanner — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

No security issues found.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: test-generator — `examples/policies/uk-regulatory/fca-financial-conduct.yaml`

AI-generated review output. Treat it as untrusted analysis and verify before acting.

examples/policies/uk-regulatory/fca-financial-conduct.yaml

  • test_fca_consumer_harm_deny -- Validate denial of outputs that mislead customers or exploit vulnerabilities.
  • test_fca_fair_value_bypass_deny -- Ensure outputs bypassing fair value assessments are denied.
  • test_fca_accountability_delegation_deny -- Verify denial of outputs delegating accountability to AI or algorithms.
  • test_fca_pricing_decision_audit -- Confirm audit logging for AI-influenced pricing or eligibility decisions.
  • test_fca_customer_communication_audit -- Validate audit logging for AI-influenced customer communications.

examples/policies/african-regulatory/rego/jurisdiction-router.rego

  • test_gb_policy_routing -- Ensure GB routes to uk_gdpr, ico_adm, and fca_conduct policies correctly.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: code-reviewer — Action items:

AI-generated review output. Treat it as untrusted analysis and verify before acting.

TL;DR: 0 blockers, 1 warning. The PR introduces a UK regulatory policy pack with comprehensive coverage and tests, but there is a potential gap in the validation of YAML policy files.

# Sev Issue Where
1 ⚠️ Lack of explicit validation for YAML policy files in CI examples/policies/uk-regulatory/*.yaml

Action items:

  1. None.

Warnings (fine as follow-up PRs):

# Issue Where
1 Add explicit CI validation for YAML policy files to ensure they conform to the expected schema and avoid runtime errors. examples/policies/uk-regulatory/*.yaml

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: docs-sync-checker — Docs Sync

AI-generated review output. Treat it as untrusted analysis and verify before acting.

Docs Sync

Documentation is in sync.

@github-actions github-actions Bot added the size/XL Extra large PR (500+ lines) label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: contributor-guide — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

Welcome, and thank you for contributing! Great job on providing detailed documentation and comprehensive test coverage for the UK regulatory policy pack.

Before merging, please address the following:

  1. Ensure the Microsoft CLA is signed as noted in your checklist.
  2. Update examples/policies/README.md to include the new uk-regulatory/ policy pack in the Policy Packs table.

Refer to CONTRIBUTING.md for guidance. Let us know if you have any questions!

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
🤖 AI Agent: breaking-change-detector — API Compatibility

AI-generated review output. Treat it as untrusted analysis and verify before acting.

API Compatibility

No breaking changes detected.

@dannyyol

dannyyol commented Jul 4, 2026

Copy link
Copy Markdown
Author

@dannyyol please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Missing No current-run comment
🛡️ Security Scan ⚠️ Missing No current-run comment
🔄 Breaking Changes ⚠️ Missing No current-run comment
📝 Docs Sync ⚠️ Missing No current-run comment
🧪 Test Coverage ⚠️ Missing No current-run comment

Verdict: ⚠️ AI review incomplete; ready for human review

AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims.

@dannyyol dannyyol changed the title Feat/uk regulatory policy pack feat(examples): add UK regulatory policy pack (UK GDPR, ICO ADM, FCA) Jul 4, 2026
@dannyyol

dannyyol commented Jul 6, 2026

Copy link
Copy Markdown
Author

@dannyyol please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@imran-siddique imran-siddique left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough pack — the Rego side is solid (41/41 OPA tests, GB wired into the shared jurisdiction router with an India-preservation regression test, and clear per-file disclaimers). One blocking issue on the YAML side.

action: escalate is not a valid PolicyAction and will fail PolicyDocument.from_yaml().

agent-governance-python/agent-os/src/agent_os/policies/schema.py defines:

class PolicyAction(str, Enum):
    ALLOW = "allow"
    DENY = "deny"
    AUDIT = "audit"
    BLOCK = "block"

There is no escalate. PolicyRule.action is typed as PolicyAction, and from_yaml() does yaml.safe_load(...)cls.model_validate(data), so loading any of these YAMLs raises a pydantic ValidationError. Affected rules (7):

  • uk-gdpr-data-protection.yaml: ukgdpr-purpose-limitation-escalate, ukgdpr-special-category-health, ukgdpr-special-category-general, ukgdpr-bulk-export-escalate, ukgdpr-cross-border-language-escalate, ukgdpr-cross-border-action-escalate
  • ico-automated-decisions.yaml: adm-recruitment-decision-escalate

The India (dpdp-data-protection.yaml) and African (popia-south-africa.yaml) packs you're modelling on deliberately use action: block for exactly this review/hold tier — none of them use escalate. That's why opa test is green (Rego defines its own independent escalate decision, unconstrained by the Python enum) while the YAML path is broken, and it's masked because CI doesn't run the YAML validator. Consistent with this, your own test-plan checkbox python -m agent_os.policies.cli validate examples/policies/uk-regulatory/*.yaml is unchecked — that step will currently fail.

Requested change: switch the 7 action: escalate rules to action: block to match the schema and the sibling packs, then run the validate command to confirm all three YAMLs load. The Rego escalate tier can stay as-is (schema-independent). The FCA YAML already uses only deny/audit/block and is fine. Happy to re-review once this is in.

@MohammadHaroonAbuomar MohammadHaroonAbuomar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation and scope corrections:

  • fca-financial-conduct.rego:52 and the yaml: PRIN 2A.1 -> PRIN 2A.4 (fair-value outcome is 2A.4).
  • uk-gdpr-data-protection.rego:49, yaml, and README: drop or scope DPA 2018 s.67. That is Part 3 (law-enforcement processing) only and conflates regimes when applied to general processing.
  • Remove "AU" from adequacy_countries; Australia is not on the UK adequacy list.
  • Drop unused lawful_basis_documented from the input-schema comment.
  • CLA check is still pending.

@dannyyol

dannyyol commented Jul 7, 2026

Copy link
Copy Markdown
Author

Thanks @imran-siddique and @MohammadHaroonAbuomar for the review, I've addressed the requested changes in the latest commit.

@imran-siddique — YAML schema

Replaced all 7 action: escalate rules with action: block in uk-gdpr-data-protection.yaml (6 rules) and ico-automated-decisions.yaml (adm-recruitment-decision-block)
Renamed the affected rule IDs from *-escalate to *-block for consistency with the sibling packs
Rego escalate tiers are unchanged (schema-independent, as suggested)
@MohammadHaroonAbuomar — citation and scope

PRIN 2A.1 → PRIN 2A.4 in fca-financial-conduct.yaml and fca-financial-conduct.rego
Removed DPA 2018 s.67 from general breach-notification citations (YAML, Rego, and pack README); general processing now cites UK GDPR Art. 33 only
Removed "AU" from adequacy_countries in uk-gdpr-data-protection.rego
Removed unused lawful_basis_documented from the Rego input-schema comment

@dannyyol

dannyyol commented Jul 7, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@MohammadHaroonAbuomar MohammadHaroonAbuomar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • DCO failing on merge commit d680879 (no Signed-off-by trailer); sign the merge or rebase instead of merge-from-main
  • Spell-check changed files failing (run 28923597705); add flagged term(s) to .cspell-repo-terms.txt

@dannyyol
dannyyol force-pushed the feat/uk-regulatory-policy-pack branch from d680879 to f82687b Compare July 8, 2026 07:59
dannyyol added 3 commits July 8, 2026 17:26
…block, corrected PRIN 2A.4 and Art. 33 citations, removed DPA s.67 from general processing scope, removed AU from adequacy list, dropped unused Rego schema field. Validated all 3 YAMLs and 41/41 OPA tests pass

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
@dannyyol
dannyyol force-pushed the feat/uk-regulatory-policy-pack branch from 5355f72 to 6657ad7 Compare July 8, 2026 16:28
@dannyyol

dannyyol commented Jul 8, 2026

Copy link
Copy Markdown
Author

Thank you @MohammadHaroonAbuomar
The DCO failing and Spell-check changed files failing are now fixed

…policy-pack

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
@dannyyol
dannyyol force-pushed the feat/uk-regulatory-policy-pack branch from 086abfc to 26b0182 Compare July 9, 2026 08:29
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file tests agent-mesh agent-mesh package agent-hypervisor agent-hypervisor package agent-sre agent-sre package security Security-related issues scripts/ci/cd labels Jul 9, 2026
@dannyyol
dannyyol force-pushed the feat/uk-regulatory-policy-pack branch from 26b0182 to 086abfc Compare July 9, 2026 08:32
@github-actions github-actions Bot removed dependencies Pull requests that update a dependency file tests agent-mesh agent-mesh package agent-hypervisor agent-hypervisor package agent-sre agent-sre package security Security-related issues scripts/ci/cd labels Jul 9, 2026
@dannyyol
dannyyol force-pushed the feat/uk-regulatory-policy-pack branch from 086abfc to 4152e55 Compare July 9, 2026 08:35
@dannyyol
dannyyol requested a review from imran-siddique July 10, 2026 09:08
@dannyyol

Copy link
Copy Markdown
Author

@MohammadHaroonAbuomar Please can you review the changes.

Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>

@imran-siddique imran-siddique left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The escalate-to-block schema fix and the citation corrections (PRIN 2A.4, s.164A, AU removal) are all in, and the YAMLs validate against the canonical schema.

kingztech2019 added a commit to kingztech2019/agent-governance-toolkit that referenced this pull request Jul 16, 2026
…packs

Per MohammadHaroonAbuomar review on PR microsoft#3243: this PR is examples-only and
must not pull in unapproved runtime schema changes. The schema revert
(c8c4d0a) removed PolicyAction.ESCALATE from schema.py and policy_schema.json.
These 28 rules across Ghana, Rwanda, Egypt, and Mauritius YAMLs are now set to
block (matching PR microsoft#3254's interim approach) until escalate is canonically
wired to escalation.py with tests and docs in a dedicated PR.
kingztech2019 added a commit to kingztech2019/agent-governance-toolkit that referenced this pull request Jul 16, 2026
…packs

Per MohammadHaroonAbuomar review on PR microsoft#3243: this PR is examples-only and
must not pull in unapproved runtime schema changes. The schema revert
(c8c4d0a) removed PolicyAction.ESCALATE from schema.py and policy_schema.json.
These 28 rules across Ghana, Rwanda, Egypt, and Mauritius YAMLs are now set to
block (matching PR microsoft#3254's interim approach) until escalate is canonically
wired to escalation.py with tests and docs in a dedicated PR.

Signed-off-by: oluwajuwon omotayo <ginuxtechacademy@gmail.com>
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants