feat(examples): add UK regulatory policy pack (UK GDPR, ICO ADM, FCA)#3254
feat(examples): add UK regulatory policy pack (UK GDPR, ICO ADM, FCA)#3254dannyyol wants to merge 13 commits into
Conversation
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>
🤖 AI Agent: security-scanner — View details
No security issues found. |
🤖 AI Agent: test-generator — `examples/policies/uk-regulatory/fca-financial-conduct.yaml`
|
🤖 AI Agent: code-reviewer — Action items:
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.
Action items:
Warnings (fine as follow-up PRs):
|
🤖 AI Agent: docs-sync-checker — Docs Sync
Docs SyncDocumentation is in sync. |
🤖 AI Agent: contributor-guide — View details
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:
Refer to CONTRIBUTING.md for guidance. Let us know if you have any questions! |
🤖 AI Agent: breaking-change-detector — API Compatibility
API CompatibilityNo breaking changes detected. |
|
PR Review Summary
Verdict: AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims. |
|
imran-siddique
left a comment
There was a problem hiding this comment.
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-escalateico-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
left a comment
There was a problem hiding this comment.
Citation and scope corrections:
fca-financial-conduct.rego:52and 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"fromadequacy_countries; Australia is not on the UK adequacy list. - Drop unused
lawful_basis_documentedfrom the input-schema comment. - CLA check is still pending.
|
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) PRIN 2A.1 → PRIN 2A.4 in fca-financial-conduct.yaml and fca-financial-conduct.rego |
|
@microsoft-github-policy-service agree |
MohammadHaroonAbuomar
left a comment
There was a problem hiding this comment.
- 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
d680879 to
f82687b
Compare
…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>
5355f72 to
6657ad7
Compare
|
Thank you @MohammadHaroonAbuomar |
…policy-pack Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
086abfc to
26b0182
Compare
26b0182 to
086abfc
Compare
086abfc to
4152e55
Compare
|
@MohammadHaroonAbuomar Please can you review the changes. |
Signed-off-by: Ayo Omotayo <ayonifeoluwa@gmail.com>
imran-siddique
left a comment
There was a problem hiding this comment.
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.
…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.
…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>
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, ordenydecisions and statutory citations on each rule.Three policy files
uk-gdpr-data-protection.yamlico-automated-decisions.yamlfca-financial-conduct.yamlAlso included
rego/(not loaded by the Agent-OS Python runtime; provided for OPA-based pipelines, mirroring feat(examples): add African regulatory policy pack (NDPA, CBN, POPIA, Kenya DPA) #3077 and feat(examples): add India regulatory policy pack (DPDP, CERT-In, RBI, SEBI, Aadhaar) #3123)rego/run_tests.sh(goes beyond feat(examples): add India regulatory policy pack (DPDP, CERT-In, RBI, SEBI, Aadhaar) #3123 which shipped without in-repo tests; aligns with feat(examples): add African regulatory policy pack (NDPA, CBN, POPIA, Kenya DPA) #3077's Rego test coverage approach)GBentry wired into the shared jurisdiction router inafrican-regulatory/rego/jurisdiction-router.regoType of Change
Package(s) Affected
Checklist
opa test— 41/41 pass viarego/run_tests.sh)Test plan
./examples/policies/uk-regulatory/rego/run_tests.sh— expect 41/41 PASSagent-governance-pythoninstalled):