Repository navigation
feat(examples): add India regulatory policy pack (DPDP, CERT-In, RBI, SEBI, Aadhaar) - #3123
Conversation
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>
|
Welcome to the Agent Governance Toolkit! Thanks for your first pull request. |
🤖 AI Agent: docs-sync-checker — Docs Sync
Docs Sync
|
🤖 AI Agent: test-generator — View details
Test coverage looks good. No gaps identified. |
🤖 AI Agent: breaking-change-detector — API Compatibility
API CompatibilityNo breaking changes detected. |
🤖 AI Agent: contributor-guide — View details
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:
Let us know if you need any assistance! |
🤖 AI Agent: security-scanner — View details
No security issues found. |
|
🟡 Contributor Check: MEDIUM
Automated check by AGT Contributor Check. |
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. |
|
@microsoft-github-policy-service agree |
Imran Siddique (imran-siddique)
left a comment
There was a problem hiding this comment.
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.
|
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 |
Imran Siddique (imran-siddique)
left a comment
There was a problem hiding this comment.
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.regocorrectly mapsINto the five India packs and adds thedata.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.
Imran Siddique (imran-siddique)
left a comment
There was a problem hiding this comment.
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 underdata.agt_policies_india.*. - All five Rego reference implementations are present and follow the
data.agt_policies_india.<pack>.decisionpath convention.
One note: the README coverage table is missing a newline at the end of file. Minor; the content itself is complete.
🤖 AI Agent: code-reviewer — Action items:
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.
Action items:
Warnings (fine as follow-up PRs):
|
|
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
left a comment
There was a problem hiding this comment.
Content and layout are solid. Two rego files fail opa check --strict (OPA 0.69.0):
rego/aadhaar-pii-protection.rego:43-45:decisionreferencescount(escalate)andcount(audit)but neither rule set is defined;rego_unsafe_var_error.rego/certin-2022-directions.rego:41-42: same pattern foraudit.
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.
|
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
Imran Siddique (imran-siddique)
left a comment
There was a problem hiding this comment.
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.
|
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
left a comment
There was a problem hiding this comment.
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 == falseonly denies on explicitfalse. An input withoutencryptedis allowed unencrypted. Usenot input.params.encrypted == true(the same pattern already used correctly at line 23 forconsent_logged).rego/sebi-governance.rego:21: same pattern forhuman_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. Omittingstorage_regionbypasses localisation enforcement. Rewrite asnot 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.
|
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. |
|
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. |
… 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>
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
Package(s) Affected
Checklist
Attribution & Prior Art
Prior art / related projects: Structure and policy format mirror the African regulatory pack (#3077, #3110) in this repository.
AI Assistance
IP, Patents, and Licensing