Skip to content

feat(examples): add India regulatory policy pack (DPDP, CERT-In, RBI, SEBI, Aadhaar) - #3123

Merged
MohammadHaroonAbuomar merged 14 commits into
microsoft:mainfrom
Mayur021:india-regulatory-pack
Jul 1, 2026
Merged

MohammadHaroonAbuomar merged 14 commits into
microsoft:mainfrom
Mayur021:india-regulatory-pack

Conversation

@Mayur021

Copy link
Copy Markdown
Contributor

Description

Adds India to AGT's regulatory coverage, mirroring the African pack (#3077, #3110). India is one of the largest regulated AI-agent markets (fintech, banking, insurtech, public sector) and had no coverage yet.

A set of starter Policy-as-Code examples that govern what an AI agent is allowed to do under Indian law: DPDP (data protection), CERT-In (incident reporting and logging), RBI (payment-data localization and KYC), SEBI (market-entity cyber resilience and AI-output accountability), and Aadhaar (identity masking). Each policy sits at the agent's action and output boundary and returns allow, audit, escalate, or deny, with the exact statutory citation on every decision. Binding vs advisory status is marked per rule; advisory/draft items (RBI FREE-AI, SEBI June-2025 guidelines) only audit, never block. Universal controls are reused via the shared jurisdiction router (IN entry added), not duplicated.

Following the African regulatory pack precedent (#3077, #3110), this ships YAML + Rego reference policies without a separate test suite. The shared router currently lives under african-regulatory/rego/; happy to relocate it to a shared path if preferred.

Type of Change

  • New feature (non-breaking change that adds functionality)

Package(s) Affected

  • 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 (pytest)
  • I have updated documentation as needed
  • I have signed the Microsoft CLA

Attribution & Prior Art

  • This contribution does not contain code copied or derived from other projects without attribution
  • Any external projects that inspired this design are credited in code comments or documentation
  • If this PR implements functionality similar to an existing open-source project, I have listed it below

Prior art / related projects: Structure and policy format mirror the African regulatory pack (#3077, #3110) in this repository.

AI Assistance

  • I can explain every meaningful change in this PR: what it does, why, and what tradeoffs were considered
  • I have run tests and verification appropriate for this change
  • No part of this PR was autonomously submitted by an AI agent without my review
  • I have not used AI to generate review comments on others' PRs

IP, Patents, and Licensing

  • This contribution does not implement patent-pending or patent-encumbered techniques
  • This contribution does not require an NDA or licensing agreement to understand or use
  • Any AI tools used have terms compatible with the MIT License

This README provides an overview of the India Regulatory Policy Pack, detailing its coverage, binding vs advisory status, and the implementation of jurisdiction-specific regulatory controls.

Signed-off-by: Mayur Agnihotri <mayur.agnihotri0021@gmail.com>
Signed-off-by: Mayur Agnihotri
  <mayur.agnihotri0021@gmail.com>
@github-actions

Copy link
Copy Markdown

Welcome to the Agent Governance Toolkit! Thanks for your first pull request.
Please ensure tests pass, code follows style (ruff check), and you have signed the CLA.
See our Contributing Guide.

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines) labels Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 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

  • examples/policies/india-regulatory/aadhaar-pii-protection.yaml -- missing docstring
  • examples/policies/india-regulatory/certin-2022-directions.yaml -- missing docstring
  • examples/policies/india-regulatory/dpdp-data-protection.yaml -- missing docstring
  • README.md -- section on regulatory coverage needs update to include the new India regulatory policy pack.
  • CHANGELOG.md -- missing entry for the addition of the India regulatory policy pack.

@github-actions

github-actions Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
🤖 AI Agent: test-generator — View details

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

Test coverage looks good. No gaps identified.

@github-actions

github-actions Bot commented Jun 20, 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.

@github-actions

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 this comprehensive addition to the project!

What you did well: The PR provides detailed documentation and well-structured Policy-as-Code examples, following the format of existing regulatory packs.

Actionable items before merge:

  1. Add a test suite for the new policies to ensure functionality and compliance, as noted in your checklist.
  2. Ensure all existing and new tests pass (pytest).
  3. Sign the Microsoft CLA to proceed with the contribution.

Let us know if you need any assistance!

@github-actions

github-actions Bot commented Jun 20, 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

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AGT Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 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.

@Mayur021

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

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.

Good addition. Mirrors the African regulatory pack structure cleanly: DPDP, CERT-In, RBI, SEBI, Aadhaar each at the action/output boundary with statutory citations. Advisory/draft rules correctly set to audit-only, never block. Jurisdiction router reused rather than duplicated. Approved.

@imran-siddique

Copy link
Copy Markdown
Collaborator

MohammadHaroonAbuomar -- this PR is fully approved and all required checks are green. Could you merge it when you get a chance?

Side note: my merge access stopped working -- looks like I was removed from the microsoft/agent-governance-toolkit maintainer team when my Microsoft account was offboarded, so my permissions dropped from maintain to push. If you can add me back to the team (or re-add as a direct collaborator with maintain role), that would unblock me from merging on my own going forward. Otherwise I'll need to route these through you for now.

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.

Well-structured India regulatory pack following the established African regulatory pattern. A few things I checked:

  • DPDP, CERT-In, RBI, SEBI, and Aadhaar coverages are correctly marked binding vs advisory/draft (RBI FREE-AI and SEBI June 2025 AI guidelines are audit-only, not blocking -- correct given their draft status)
  • The jurisdiction router extension at african-regulatory/rego/jurisdiction-router.rego correctly maps IN to the five India packs and adds the data.agt_policies_india.* query paths
  • The disclaimer (NOT certified legal compliance) mirrors the African pack disclaimer
  • s.16 DPDP restriction list being currently empty is correctly handled (no country hardcoded as blocked)

Only the maintainer gate is failing.

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 India regulatory pack looks solid. Policy structure is consistent with the African pack (same YAML schema, same Rego reference implementation pattern, same jurisdiction-router integration), regulatory references are accurate, and the README correctly distinguishes binding obligations from advisory/draft status.

A few specific things I checked:

  • DPDP consent and purpose-limitation rules look correct for the Act as notified.
  • CERT-In 6-hour reporting window and 180-day log retention match the 2022 Directions.
  • Aadhaar masking regex (\d{12}) is reasonable; the disclaimer about false-positives on legitimate 12-digit numbers is appropriate.
  • SEBI CSCRF + AI/ML amendment coverage is there.
  • RBI data localization file is present.
  • The jurisdiction router correctly maps "IN" to the five policy packs under data.agt_policies_india.*.
  • All five Rego reference implementations are present and follow the data.agt_policies_india.<pack>.decision path convention.

One note: the README coverage table is missing a newline at the end of file. Minor; the content itself is complete.

@github-actions

github-actions Bot commented Jun 22, 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: 1 blocker, 2 warnings. The PR introduces a significant regulatory policy pack for India but lacks critical test coverage and has minor issues that can be addressed in follow-up PRs.

# Sev Issue Where
1 Blocker Missing test suite for new policy pack, risking unverified behavior. New policies and jurisdiction router changes
2 Warning Potential regex false positives in Aadhaar policy (e.g., legitimate 12-digit numbers). aadhaar-pii-protection.yaml
3 Warning Known gaps in regulatory coverage not explicitly marked in rules as "TODO" for future work. README.md

Action items:

  1. Add a comprehensive test suite for the new India regulatory policy pack and jurisdiction router changes.

Warnings (fine as follow-up PRs):

# Issue Suggested Action
2 Potential regex false positives in Aadhaar policy. Review and refine regex patterns to minimize false positives.
3 Known gaps in regulatory coverage not explicitly marked in rules. Add TODO comments in the code for missing regulatory obligations.

@Mayur021

Copy link
Copy Markdown
Contributor Author

Thanks Imran , appreciate the thorough pass, especially confirming the binding-vs-advisory marking and the router paths. On the README newline, I can push that fix if useful, but I held off so a cosmetic commit would not reset your review, and a squash-merge normalizes it anyway. On the maintainer gate, is there a maintainer I should tag to take it across, or does it route on its own?

@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.

Content and layout are solid. Two rego files fail opa check --strict (OPA 0.69.0):

  • rego/aadhaar-pii-protection.rego:43-45: decision references count(escalate) and count(audit) but neither rule set is defined; rego_unsafe_var_error.
  • rego/certin-2022-directions.rego:41-42: same pattern for audit.

Either drop the unused arms from the decision ladder or add stub escalate contains _ if { ... } / audit contains _ if { ... } rules (the sibling bvn-nin-protection.rego defines all three tiers, which is why its identical decision block compiles).

Minor: aadhaar-pii-protection.yaml:35 uses \\b\\d{12}\\b while rego/aadhaar-pii-protection.rego:19 uses \\d{12}\\b. Pick one for parity.

@Mayur021

Copy link
Copy Markdown
Contributor Author

aadhaar-pii-protection.rego: defined both missing tiers as empty sets (escalate := set() / audit := set()), since it's deny/allow only. certin-2022-directions.rego: added audit := set() only; its escalate NTP-sync rule stays as is. Empty sets rather than dropping the arms, so the 4-arm decision ladder stays uniform with dpdp/rbi/sebi and bvn-nin. opa check --strict passes on both and on the full pack under 0.69.0.

Regex parity: dropped the \b before \d{12} in aadhaar-pii-protection.yaml so it matches the rego. The rego form is the more permissive match, the right default for a PII deny rule.

Want me to add a small opa check --strict CI step for the pack, or keep that out of this PR's scope?

Fix opa check --strict: define empty escalate/audit tiers

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 India regulatory pack content is well-structured and follows the African pack precedent closely. Regulatory citations, binding/advisory distinctions, and jurisdiction router integration are all correct. A few things to address before merge:\n\nBlocking: OPA fixes need to land as a commit\n\nMohammadHaroonAbuomar's CHANGES_REQUESTED review (2026-06-24) identified two opa check --strict failures:\n- rego/aadhaar-pii-protection.rego: decision references count(escalate) and count(audit) but neither rule set is defined.\n- rego/certin-2022-directions.rego: same pattern for audit.\n\nThe contributor described the fixes (adding escalate := set() / audit := set() stubs) in a comment, but all CI runs and reviews reference the same commit d4c57f86. If those stub additions have not been pushed as a new commit, the rego files still do not compile under --strict. Please push the fix so CI can validate it and MohammadHaroonAbuomar can re-review and dismiss the CHANGES_REQUESTED state.\n\nMaintainer gate\n\nThe "Policy: Awaiting maintainer review" check is failing. This is a required gate per project CI. Per the thread, imran-siddique's merge access was revoked when their Microsoft account was offboarded. A maintainer with the required permissions needs to approve and merge this PR.\n\nMinor: jurisdiction router placement\n\nThe PR extends african-regulatory/rego/jurisdiction-router.rego to include "IN". This works but is architecturally odd for a non-Africa jurisdiction. Happy to leave it as-is for now given the contributor offered to relocate it, but a follow-up to move the router to a shared path would be cleaner.\n\nTests\n\nThe PR ships without a test suite, consistent with the African pack precedent (#3077, #3110). The contributor offered to add an opa check --strict CI step for the pack. That would be a low-effort improvement worth doing either here or in a follow-up.

fix: define escalate/audit sets for opa check --strict.
@Mayur021

Copy link
Copy Markdown
Contributor Author

The escalate/audit fix landed in commit 41d83ed ("fix: define escalate/audit sets for opa check"), which is after the d4c57f8 that the earlier CI runs and reviews referenced. On the current head, opa check --strict resolves: Aadhaar defines escalate and audit as empty sets (deny/allow only), and CERT-In keeps the NTP escalate rule with audit empty. All checks are green on the latest commit.

MohammadHaroonAbuomar could you re-review and dismiss the CHANGES_REQUESTED when you have a moment?

Imran Siddique (@imran-siddique) you flagged the maintainer-merge gate, and maintainer-approval-status is now passing on the latest commit. Since your merge access was revoked, who should I tag to do the merge?

@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.

The regulatory citations are strong (17 of ~20 references exact, correct circular numbers and dates, binding vs advisory correctly distinguished). Three section-number errors and several fail-open rego patterns need fixing before this lands.

Factual citation errors

File Says Should be
dpdp-data-protection.yaml:13,50 DPDP s.8(3) for erasure when purpose served s.8(7) (s.8(3) is the accuracy/completeness duty)
certin-2022-directions.yaml:12,55 and rego/certin-2022-directions.rego:33-36 Direction (iii) for NTP synchronisation Direction (i) (Direction (iii) is PoC designation and compliance with CERT-In orders)
aadhaar-pii-protection.yaml:55 and rego/aadhaar-pii-protection.rego:39 s.29(2)/(3) for public display prohibition s.29(4) (post-2019 amendment; s.29(3) is purpose limitation)

Also: aadhaar-pii-protection.yaml:43 and rego:31 list "retina" as a biometric. UIDAI core biometrics are fingerprint, iris, and face; retina is not collected.

Fail-open rego patterns

These deny rules only fire when the parameter is explicitly set to the wrong value; an input that simply omits the field passes.

  • rego/dpdp-data-protection.rego:30: input.params.encrypted == false only denies on explicit false. An input without encrypted is allowed unencrypted. Use not input.params.encrypted == true (the same pattern already used correctly at line 23 for consent_logged).
  • rego/sebi-governance.rego:21: same pattern for human_accountable == false.
  • rego/certin-2022-directions.rego:28-29, rego/sebi-governance.rego:37-38, rego/rbi-data-localization.rego:22-23: input.params.<region_field> != null; != "IN". In Rego an undefined field makes the comparison undefined, so the rule body fails silently and the request is allowed. Omitting storage_region bypasses localisation enforcement. Rewrite as not input.params.<field> == "IN" so absence and any non-IN value both deny.

Aadhaar detection too narrow

aadhaar-pii-protection.yaml:34 and rego:19,25: aadhaar\\D{0,15}\\d{12}\\b requires the literal token "aadhaar"/"uid" nearby and 12 contiguous digits. It misses bare numbers, the common single-a misspelling "Aadhar", Hindi "आधार", and the standard display formats 1234 5678 9012 / 1234-5678-9012. An agent emitting a real formatted Aadhaar passes. Add a second pattern for \\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4} and include "aadhar" in the keyword alternation.

Coverage gaps to list in the README

These are material obligations the pack does not represent. Listing them as "not covered" keeps the example honest:

  • DPDP: s.9 children's data (verifiable parental consent, no behavioural monitoring of minors); ss.11-14 Data Principal rights; s.5 notice.
  • CERT-In: Direction (v) cloud/VPS/VPN provider 5-year subscriber-record retention; Annexure-I 20-incident schedule.
  • RBI: System Audit Report (SAR) by CERT-In-empanelled auditor; Outsourcing MD exit-strategy and concentration-risk clauses.
  • SEBI: CSCRF 6-hour reporting window (currently "mandated timelines" only); SBOM; Cyber Capability Index; Reg 16A disclosure of AI/ML use to SEBI.
  • Aadhaar: Aadhaar Data Vault (mandatory reference-key tokenisation and HSM encryption for any entity storing Aadhaar numbers); Virtual ID; AUA/KUA licensing gate.

Note

The output-side rules match intent phrases ("store PII unencrypted", "keep payment data abroad"), so they catch an agent narrating misconduct rather than committing it. That is acceptable for an examples/ pack, but the README disclaimer should say so explicitly so users do not treat these as compliance controls.

@Mayur021

Mayur Agnihotri (Mayur021) commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the depth here, MohammadHaroonAbuomar. All accepted and pushed in 3ed9855.

Citations corrected: DPDP s.8(7) for erasure, CERT-In Direction (i) for NTP, Aadhaar s.29(4) for public display (2019 amendment), and retina removed from the biometric set (fingerprint/iris/face).

Fail-open denies rewritten so an omitted field now denies (for example not input.params.encrypted == true in place of == false); on the region rules I used object.get for the message so the sprintf does not re-introduce the open path on an absent field.

Aadhaar detection now covers the aadhar spelling, Hindi आधार, and the grouped 1234 5678 9012 / 1234-5678-9012 display formats; I required a separator on the grouped pattern rather than matching every bare 12-digit run, and can widen it to your exact pattern if you prefer max recall over precision.

README now lists the not-covered obligations you flagged and states the rules are intent-phrase detection heuristics, not compliance controls.

Ready for another look whenever you have a moment.

@MohammadHaroonAbuomar

Copy link
Copy Markdown
Collaborator

Mayur Agnihotri (@Mayur021) thanks for making the changes. I'm going to ignore the DCO check this time. Please make sure to sign your commits on future PRs.

@MohammadHaroonAbuomar
MohammadHaroonAbuomar merged commit c14c59b into microsoft:main Jul 1, 2026
87 of 90 checks passed
Tionne Smith (electricwolfemarshmallowhypertext) pushed a commit to electricwolfemarshmallowhypertext/ms-agt that referenced this pull request Oct 12, 2026
… SEBI, Aadhaar) (microsoft#3123)

* feat(examples): add India regulatory pack README

This README provides an overview of the India Regulatory Policy Pack, detailing its coverage, binding vs advisory status, and the implementation of jurisdiction-specific regulatory controls.

Signed-off-by: Mayur Agnihotri <mayur.agnihotri0021@gmail.com>

* feat(examples): add DPDP data-protection policy

Signed-off-by: Mayur Agnihotri
  <mayur.agnihotri0021@gmail.com>

* Refine comments and messages in DPDP policy

* Add files via upload

* Add files via upload

* Fix opa check --strict

Fix opa check --strict: define empty escalate/audit tiers

* Regex parity: drop \b before \d{12} to match rego

* fix: define escalate/audit sets for opa check

fix: define escalate/audit sets for opa check --strict.

* Add files via upload

---------

Signed-off-by: Mayur Agnihotri <mayur.agnihotri0021@gmail.com>
Co-authored-by: Imran Siddique <45405841+imran-siddique@users.noreply.github.com>
Co-authored-by: MohammadHaroonAbuomar <40180927+MohammadHaroonAbuomar@users.noreply.github.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 needs-review:MEDIUM Contributor check flagged MEDIUM risk size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants