Architects in regulated environments must prove that every architectural decision accounts for applicable compliance obligations. This prompt takes an ADR and a set of regulatory controls, standards, or internal policies and produces a traceability matrix that maps each ADR section to specific requirements. It also detects gaps where the ADR fails to address a mandatory control. Use this prompt before an ADR is approved, during audit preparation, or when a new regulation takes effect and existing decisions must be re-evaluated.
Prompt
ADR Compliance Mapping Prompt

When to Use This Prompt
Understand the specific job, required inputs, and boundaries for the ADR Compliance Mapping Prompt before integrating it into a regulated workflow.
This is not a general-purpose compliance tool. It assumes the ADR text and the control catalog are already written and available as input. It does not interpret regulations, provide legal advice, or replace a qualified compliance officer. Human review is required for all gap findings before they become action items. The prompt works best when the control catalog is structured with clear identifiers and requirement text, and when the ADR contains explicit sections for context, decision, and consequences. If your ADR is a single paragraph of prose or your controls are vague policy statements, the mapping quality will degrade significantly.
Do not use this prompt to generate compliance evidence from scratch, to certify a system as compliant, or to interpret new regulations that have not been translated into discrete controls. The output is a traceability artifact that supports human review and audit workflows—it is not a substitute for a compliance officer's judgment. Before running this prompt in production, validate the output against a golden set of manually mapped ADRs to calibrate your acceptance criteria for gap detection precision and recall.
Use Case Fit
Where the ADR Compliance Mapping Prompt works, where it fails, and what you must provide before running it.
Good Fit: Regulated Industries with Known Control Frameworks
Use when: You have a finalized ADR and a defined compliance standard (SOC 2, HIPAA, PCI-DSS, GDPR, FedRAMP). The prompt excels at mapping narrative decisions to specific control IDs. Guardrail: Always provide the full control text in [COMPLIANCE_STANDARD]; do not rely on the model's parametric knowledge of regulations, which may be outdated or hallucinated.
Bad Fit: Undefined or Principle-Based Regulations
Avoid when: Your compliance obligation is a high-level principle like 'privacy by design' or 'act in the customer's best interest' without specific, auditable control clauses. Risk: The model will invent plausible-sounding but non-authoritative control mappings, creating false assurance. Guardrail: Use this prompt only after translating principles into explicit, verifiable control statements.
Required Inputs: Structured ADR and Canonical Control Text
Risk: Garbage in, garbage out. An incomplete ADR or a summarized compliance standard will produce a traceability matrix with dangerous gaps. Guardrail: The [ADR_DOCUMENT] must contain explicit sections for Context, Decision, and Consequences. The [COMPLIANCE_STANDARD] must be the authoritative control text, not a blog post summary. Validate input completeness before invoking the prompt.
Operational Risk: False Negatives in Gap Detection
Risk: The model may fail to identify a missing compliance obligation, leading to an audit failure. This is common when a control is implied but not explicitly stated in the ADR. Guardrail: Never use the output as the sole compliance artifact. Implement a human-in-the-loop review step where a compliance officer signs off on the gap analysis before the traceability matrix is finalized.
Operational Risk: Hallucinated Control Mappings
Risk: The model may link an ADR section to a control ID that sounds relevant but does not actually apply, creating a false positive in the traceability matrix. Guardrail: Add a post-processing validation step that verifies each mapped control ID exists in the provided [COMPLIANCE_STANDARD] source text using exact string matching or a lookup against a canonical control list.
Process Fit: Pre-Audit Preparation, Not Real-Time Certification
Use when: You are preparing evidence for an upcoming audit or internal review. Avoid when: You need a real-time compliance certification as part of a CI/CD pipeline. Risk: The prompt performs a point-in-time analysis; it cannot detect drift in the ADR or the compliance standard. Guardrail: Tie this prompt to a version-controlled ADR repository and re-run it whenever the ADR or the applicable regulatory framework is updated.
Copy-Ready Prompt Template
A reusable prompt template for mapping ADR decisions to compliance requirements, ready to paste into your AI harness with square-bracket placeholders.
This prompt template is designed to produce a traceability matrix that links each section of an Architecture Decision Record to specific regulatory controls, standards, or policy requirements. It also flags gaps where compliance obligations are unmet. The template uses square-bracket placeholders that you replace with your actual ADR content, compliance framework, and output constraints before sending it to the model. The prompt is structured to enforce evidence grounding, require explicit control references, and produce a machine-readable output schema suitable for downstream compliance tooling.
textYou are a compliance architect reviewing an Architecture Decision Record (ADR) against a regulatory framework. Your task is to produce a traceability matrix that maps each ADR section to applicable compliance controls and identifies gaps where obligations are unmet. ## INPUTS ### ADR Content [ADR_CONTENT] ### Compliance Framework [COMPLIANCE_FRAMEWORK] ### Additional Context [CONTEXT] ## OUTPUT SCHEMA Return a valid JSON object with this structure: { "adr_identifier": "string", "framework": "string", "mapping": [ { "adr_section": "string", "adr_claim": "string", "applicable_controls": [ { "control_id": "string", "control_text": "string", "mapping_rationale": "string", "compliance_status": "mapped | partial | gap", "evidence_in_adr": "string or null", "gap_description": "string or null", "remediation_guidance": "string or null" } ] } ], "unmapped_controls": [ { "control_id": "string", "control_text": "string", "reason_not_addressed": "string", "risk_level": "high | medium | low", "recommended_action": "string" } ], "summary": { "total_controls_mapped": "number", "total_controls_partial": "number", "total_gaps": "number", "overall_risk_assessment": "string" } } ## CONSTRAINTS - Only reference controls that actually exist in [COMPLIANCE_FRAMEWORK]. Do not invent control IDs. - For each mapping, cite the specific text or claim from the ADR that addresses the control. If no text addresses it, set compliance_status to "gap" and evidence_in_adr to null. - Do not assume compliance intent. If the ADR does not explicitly address a control, flag it as a gap. - If a control is partially addressed, explain what is missing in gap_description. - For unmapped_controls, list every control in [COMPLIANCE_FRAMEWORK] that has no corresponding ADR section. Do not skip controls. - Use the exact control_id format from [COMPLIANCE_FRAMEWORK]. - If [RISK_LEVEL] is provided, use it to calibrate gap severity. Otherwise, assess risk based on control criticality. ## EXAMPLES [EXAMPLES] ## RISK LEVEL [RISK_LEVEL]
To adapt this prompt, replace each square-bracket placeholder with your actual data. [ADR_CONTENT] should contain the full text of the ADR you are reviewing. [COMPLIANCE_FRAMEWORK] should list the specific controls, standards, or policy requirements you need to map against—ideally with control IDs and full text. [CONTEXT] can include organizational policies, risk appetite statements, or domain-specific regulatory interpretations. [EXAMPLES] is optional but strongly recommended: provide one or two correct mapping examples to calibrate the model's judgment on what constitutes adequate evidence. [RISK_LEVEL] accepts values like high, medium, or low to calibrate gap severity assessment. After generating the output, validate the JSON schema before ingesting it into your compliance tracking system. For regulated environments, always route the output through human review before treating any gap as confirmed or closed.
Prompt Variables
Inputs the ADR Compliance Mapping Prompt needs to produce a reliable traceability matrix. Each variable must be validated before the prompt is called to prevent hallucinated controls or missing regulatory gaps.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[ADR_TEXT] | The full body of the Architecture Decision Record to be mapped against compliance requirements | ADR-0042: Event Sourcing for Order Management | Must be non-empty string. Check for required ADR sections (Context, Decision, Consequences). Reject if < 200 characters or missing decision rationale. |
[COMPLIANCE_FRAMEWORK] | The specific regulatory standard, policy, or control framework to map against | SOC 2 Type II (CC5.1–CC5.3, CC6.1–CC6.8) | Must resolve to a known framework identifier. Validate against an allowed-frameworks list. Reject free-text frameworks not in the organization's compliance registry. |
[CONTROL_CATALOG] | The authoritative list of controls, requirements, or policy statements from the framework | CC6.1: Logical access controls; CC7.1: Incident detection | Must be a structured list with control IDs and descriptions. Validate that each control has a unique ID and non-empty description. Null allowed if framework is self-contained in the prompt. |
[ORGANIZATION_CONTEXT] | Internal policies, risk appetite statements, or domain-specific compliance interpretations | Data classification policy v2.3; PII must be encrypted at rest and in transit | Optional but recommended. If provided, validate that it contains policy names or references traceable to internal documents. Warn if context contradicts framework requirements. |
[GAP_SEVERITY_THRESHOLD] | The minimum severity level for reporting compliance gaps | Medium | Must be one of: Critical, High, Medium, Low. Default to Medium if not provided. Validate against allowed enum. Controls gap detection sensitivity. |
[OUTPUT_FORMAT] | The desired structure for the traceability matrix output | JSON with fields: control_id, adr_section, compliance_status, evidence, gap_description, severity | Must be a valid schema definition. Validate parseability as JSON schema or structured format specification. Reject ambiguous format descriptions. |
[EVIDENCE_REQUIREMENT] | Whether the prompt must cite specific ADR passages as evidence for each mapping | Boolean. If true, output must include direct quotes or section references from ADR_TEXT. If false, summary-level mapping is acceptable. Validate as boolean parseable. |
Implementation Harness Notes
How to wire the ADR Compliance Mapping Prompt into a regulated engineering workflow with validation, retries, and human review.
This prompt is designed to be integrated into a document processing pipeline, not used as a one-off chat interaction. The typical harness ingests a draft ADR (often from a version-controlled repository), a compliance standard document, and a jurisdiction or risk profile tag, then produces a structured traceability matrix. Because the output is used for audit evidence, the harness must enforce schema validation, log every run, and route low-confidence or incomplete mappings to a human reviewer before the matrix is accepted.
Start by constructing the prompt with the required placeholders: [ADR_TEXT] should be the full markdown or plain text of the architecture decision record; [COMPLIANCE_STANDARD] should contain the relevant regulatory text, control catalog, or policy document (e.g., SOC 2 criteria, HIPAA Security Rule sections, or an internal InfoSec policy); [JURISDICTION] is a short tag like 'US-HIPAA', 'EU-GDPR', or 'PCI-DSS-4.0' that helps the model scope its mapping behavior. The [OUTPUT_SCHEMA] placeholder should be populated with a strict JSON schema defining the expected traceability matrix structure—each row must include the ADR section identifier, the mapped control ID, a confidence score, a rationale snippet, and a gap flag. Validate the model's output against this schema immediately. If validation fails, retry once with the validation error injected into the [CONSTRAINTS] field. If the second attempt also fails, escalate to a human review queue with the raw output and error log attached.
Model choice matters here. Use a model with strong instruction-following and long-context handling, such as claude-sonnet-4-20250514 or gpt-4o, because ADRs and compliance standards can each exceed several thousand tokens. Set temperature to 0 or a very low value (0.1) to maximize deterministic mapping behavior. For regulated environments where data must not leave a private boundary, deploy the prompt against a self-hosted model or a private cloud inference endpoint. Log every request and response, including the prompt version hash, model ID, timestamp, and validation result, to an append-only audit store. This log becomes part of the compliance evidence chain.
The most common production failure mode is a gap detection false negative—the model maps an ADR section to a control but misses a sub-requirement that is not explicitly stated in the standard text. Mitigate this by maintaining a curated list of known 'hidden requirements' for each standard and injecting them into the [CONTEXT] placeholder as supplementary guidance. A secondary failure mode is over-mapping, where the model forces a relationship between an ADR section and a control that doesn't genuinely apply. To catch this, implement a confidence threshold (e.g., 0.7) below which mappings are automatically flagged for human review. The human reviewer should be able to accept, reject, or amend each mapping row through a simple UI that writes the final approved matrix back to the ADR repository as an artifact.
Do not treat this prompt as a replacement for a qualified compliance officer or legal review. The harness should enforce that every generated matrix includes a mandatory human attestation step before it can be merged into the official ADR record. Wire the approval gate into your CI/CD pipeline if ADRs are stored in a version control system: the PR that adds the compliance mapping artifact should be blocked until an authorized reviewer approves it. This keeps the workflow auditable and prevents unverified AI output from becoming part of the compliance record.
Expected Output Contract
Each field the ADR Compliance Mapping Prompt must return, with its type, whether it is required, and the validation rule to apply before accepting the output.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
compliance_matrix | Array of objects | Schema check: array length >= 1. Each element must match the compliance_entry schema. | |
compliance_entry.adr_section | String | Enum check: must match one of ['Context', 'Decision', 'Options Considered', 'Trade-offs', 'Consequences', 'Rationale']. | |
compliance_entry.control_id | String | Format check: must match pattern ^[A-Z]{2,4}-\d{2,4}$ (e.g., SOC2-CC6.1, HIPAA-164.312). | |
compliance_entry.control_description | String | Length check: 20-300 characters. Must not be a verbatim copy of the control_id. | |
compliance_entry.mapping_status | String | Enum check: must be one of ['directly_addressed', 'partially_addressed', 'gap_identified', 'not_applicable']. | |
compliance_entry.evidence | String or null | Conditional check: required when mapping_status is 'directly_addressed' or 'partially_addressed'. Must quote or cite specific ADR text. | |
compliance_entry.gap_description | String or null | Conditional check: required when mapping_status is 'gap_identified'. Must describe the unmet obligation in 30-300 characters. | |
unmapped_controls | Array of strings | Schema check: if present, each element must be a control_id not present in the compliance_matrix. Used for controls the ADR does not address at all. |
Common Failure Modes
When mapping ADRs to compliance requirements, these are the most common failure modes that cause traceability gaps, audit failures, and rework.
Vague Control References
What to watch: The prompt maps ADR sections to generic labels like 'security requirement' or 'data protection' instead of specific control IDs (e.g., SOC 2 CC6.1, HIPAA §164.312). Auditors reject vague references. Guardrail: Require the prompt to cite exact control identifiers from a provided standards catalog. Add a post-processing validator that flags any mapping without a control ID pattern match.
Hallucinated Compliance Gaps
What to watch: The model invents unmet obligations that don't exist in the actual regulatory framework, creating false remediation work and misleading audit trails. This happens most when the standards catalog is incomplete or absent from the prompt context. Guardrail: Ground every gap claim against a provided standards document. Require the output to quote the specific clause that creates the obligation. Flag gaps without source quotes for human review.
Over-Mapping Noise
What to watch: The prompt maps every ADR section to every possible control, producing a dense but useless matrix where nothing is actually traceable. This hides real gaps in a flood of low-confidence associations. Guardrail: Require confidence levels for each mapping. Set a minimum confidence threshold and suppress low-confidence entries. Add a 'directly applicable' vs 'tangentially related' distinction in the output schema.
Missing Negative Findings
What to watch: The prompt only reports positive mappings and fails to identify ADR sections that have no corresponding compliance coverage. The traceability matrix looks complete but silently omits unprotected decisions. Guardrail: Explicitly require a 'compliance gaps' section that lists every ADR section with zero applicable controls. Add a completeness check that counts ADR sections in the input and verifies each appears in either the mapping or the gap list.
Stale Standards Drift
What to watch: The prompt uses an outdated version of a regulatory standard embedded in its training data rather than the current version provided in context. This produces mappings that reference deprecated or renamed controls. Guardrail: Always provide the current standards document as input. Include a version header in the prompt and instruct the model to reject any control reference not present in the provided document. Add a validator that cross-references output control IDs against the input catalog.
Rationale-Free Mappings
What to watch: The prompt produces a matrix of ADR-section-to-control pairs with no explanation of why each mapping exists. During an audit, reviewers cannot assess whether the mapping is defensible. Guardrail: Require a one-sentence rationale for every mapping entry explaining how the ADR content satisfies or relates to the control. Add a minimum rationale length check to catch empty or placeholder text.
Evaluation Rubric
Use this rubric to test the ADR Compliance Mapping Prompt before shipping. Each criterion targets a specific failure mode common in compliance traceability outputs.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Control-to-Section Linkage | Every compliance control in [REGULATORY_CONTROLS] maps to at least one specific ADR section identifier | Output contains orphan controls with no ADR section reference or maps to vague labels like 'Architecture section' | Parse output JSON; assert length of mapped_sections > 0 for each control entry |
Gap Detection Completeness | All controls with zero mapped ADR sections appear in a dedicated gaps array with a severity classification | Unmapped controls are silently omitted or listed without severity; gap array is empty when controls are missing | Diff the set of input control IDs against the union of mapped and gapped control IDs; assert empty diff |
Evidence Grounding | Each mapping includes a direct quote or paraphrase from the ADR text that supports the compliance claim | Mapping rationale contains only generic statements like 'this control is covered' without citing ADR content | Sample 5 random mappings; assert rationale field contains substring present in [ADR_TEXT] or a close semantic match via embedding similarity > 0.85 |
Regulatory Control ID Preservation | All control identifiers from the input appear verbatim in the output without modification, truncation, or renumbering | Control IDs are reformatted, concatenated, or missing characters; original IDs are unrecoverable | Exact string match between input control ID list and all control_id fields in output |
False Positive Rate | No mapping claims coverage when the ADR section addresses a different control domain (e.g., mapping an availability control to a security section) | Output maps a control to an ADR section that discusses an unrelated topic; rationale is forced or irrelevant | Human review of 10 random mappings; assert fewer than 1 false positive on average across 3 test ADRs |
Output Schema Validity | Output is valid JSON matching the [OUTPUT_SCHEMA] exactly, including all required fields and correct types | Output is malformed JSON, missing required fields, or contains extra undeclared fields that break downstream parsers | Validate against JSON Schema; assert no errors on required fields, types, or additionalProperties constraint |
Uncertainty Flagging | Mappings with low confidence include an uncertainty flag and a reason (e.g., 'ADR section implies coverage but does not state it explicitly') | All mappings have high confidence or uncertainty fields are present but always null even for ambiguous cases | Check that at least one mapping in a test set with deliberately ambiguous ADRs has uncertainty_level set to 'low' or 'medium' |
Non-ADL Control Exclusion | Controls that are not applicable to architecture decisions (e.g., HR policy, physical security) are flagged as out-of-scope rather than mapped or gapped | Output attempts to map non-architectural controls to ADR sections, producing spurious or misleading traceability | Include 2 known non-ADL controls in test input; assert they appear in an out_of_scope array, not in mappings or gaps |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a single regulation (e.g., SOC 2, GDPR Article 32). Use a lightweight output schema—a simple markdown table with columns for [ADR_SECTION], [CONTROL_ID], [MAPPING_STATUS], and [EVIDENCE]. Skip automated validation. Run manually on 2–3 ADRs to calibrate mapping expectations.
Watch for
- The model inventing control IDs that don't exist in the actual regulation
- Over-mapping: claiming every ADR section satisfies a control when it doesn't
- Missing the distinction between 'addressed' and 'partially addressed'
- No gap detection—the prototype may only map positives without flagging unmet obligations

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us