This prompt is designed for tax and accounting software teams building AI features that must reason over a corpus of tax authority documents. It ranks retrieved statutes, IRS rulings, treasury regulations, private letter rulings, and other guidance by jurisdiction, authority level, effective date, and taxpayer-specific applicability. The output is a hierarchical evidence brief that downstream answer-generation prompts can consume. Use this prompt when generic relevance ranking is insufficient and you need the model to apply domain-specific authority rules before synthesizing an answer.
Prompt
Tax Authority Evidence Ranking Prompt Template

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the Tax Authority Evidence Ranking prompt.
The ideal user is an engineering lead or AI product manager integrating tax research capabilities into a professional tax preparation, audit support, or corporate tax workflow product. Required context includes a pre-retrieved set of tax documents, the taxpayer's jurisdiction and entity type, the tax year or period in question, and the specific tax issue being researched. The prompt expects the model to weigh primary authority (Internal Revenue Code, Treasury Regulations, judicial decisions) above secondary authority (IRS publications, private letter rulings, commentary), and to flag superseded or obsolete guidance. It is not a substitute for a tax professional's judgment; always route final determinations to a qualified human reviewer.
Do not use this prompt when the retrieved document set is empty, when the tax question is purely computational, or when the user expects a final tax position rather than an evidence brief. This prompt is a ranking and structuring step in a multi-stage pipeline, not an end-to-end answer generator. If your application requires a direct answer to a taxpayer question, chain this prompt's output into a downstream synthesis prompt that includes explicit grounding and citation instructions. For high-risk scenarios involving penalty exposure, criminal tax matters, or positions contrary to published guidance, add a mandatory human-review gate after the evidence brief is generated and before any answer reaches the user.
Use Case Fit
Where the Tax Authority Evidence Ranking prompt works, where it fails, and what inputs and operational risks to plan for before integrating it into a tax or accounting product.
Good Fit: Jurisdiction-Aware Tax Research
Use when: your product retrieves statutes, revenue rulings, or administrative guidance across multiple jurisdictions and must rank them by authority level. Guardrail: always include jurisdiction and taxpayer entity type as required inputs; generic ranking without jurisdiction context produces misleading authority scores.
Good Fit: Time-Sensitive Guidance Selection
Use when: effective dates and sunset provisions determine whether guidance applies to a specific tax year. Guardrail: require an explicit tax-year or transaction-date input and test eval cases where a newer ruling supersedes an older one without an explicit repeal statement.
Bad Fit: Unstructured General Tax Questions
Avoid when: the user asks an open-ended tax question without a specific taxpayer fact pattern or jurisdiction. Guardrail: route vague queries to a clarification step before invoking evidence ranking; ranking without a fact pattern produces generic results that may mislead users about applicability.
Required Inputs: Fact Pattern and Retrieval Set
Risk: the prompt cannot rank evidence without a structured taxpayer fact pattern and a pre-retrieved set of candidate documents. Guardrail: validate that both [TAXPAYER_CONTEXT] and [RETRIEVED_EVIDENCE] are populated before calling the ranking prompt; return a controlled error if either is missing.
Operational Risk: Superseded Guidance
Risk: the model may rank a superseded revenue ruling highly because it matches the query text, missing a later ruling that modifies or obsoletes it. Guardrail: implement a post-ranking eval that checks for explicit supersession markers and effective-date conflicts; flag any ranked item where a newer authority on the same topic exists in the retrieval set.
Operational Risk: Circular Cross-References
Risk: tax guidance documents frequently cross-reference each other, creating circular authority chains that the model may present as independent support. Guardrail: add an eval step that detects when two or more ranked items cite only each other as primary authority; downgrade confidence and flag for human review when circularity is detected.
Copy-Ready Prompt Template
Paste this prompt into your application, replacing the square-bracket placeholders with real data. The prompt instructs the model to rank evidence by authority, flag conflicts, and produce a structured JSON brief.
This template is the core instruction set for ranking tax authority evidence. It is designed to be copied directly into your model request, with placeholders replaced by your application's runtime data. The prompt enforces a strict hierarchy: jurisdiction first, then authority level, effective date, and taxpayer-specific applicability. It also requires the model to flag superseded guidance and circular cross-references, which are common failure modes in tax research.
textYou are a tax research evidence ranking assistant. Your task is to analyze the provided tax documents and produce a structured JSON brief that ranks evidence by authority and applicability. ## INPUT [QUERY] [RETRIEVED_DOCUMENTS] ## CONSTRAINTS - Rank evidence using this strict hierarchy: 1. Jurisdiction match (federal > state > local; must match taxpayer jurisdiction in [TAXPAYER_CONTEXT]) 2. Authority level (Statute > Regulation > Revenue Ruling > Private Letter Ruling > IRS Notice > Publication > Commentary) 3. Effective date (most recent applicable period first; flag any document not yet effective or expired) 4. Taxpayer-specific applicability (directly addresses facts in [TAXPAYER_CONTEXT] > analogous situation > general guidance) - For each piece of evidence, assign a confidence score from 0.0 to 1.0 reflecting how directly it applies. - Flag any evidence that has been superseded, revoked, or modified by later authority. Cite the superseding document if present in the retrieved set. - Detect and flag any circular cross-references where Document A cites Document B and Document B cites Document A as primary authority. - If two documents conflict, surface the conflict explicitly and explain which authority prevails under the hierarchy. - Do not invent citations, code sections, or rulings not present in the input. ## OUTPUT_SCHEMA Return a single JSON object with this structure: { "query_summary": "string summarizing the tax question", "jurisdiction_analysis": { "taxpayer_jurisdiction": "string", "matching_documents": ["list of document IDs matching jurisdiction"], "non_matching_documents": ["list of document IDs from other jurisdictions"] }, "ranked_evidence": [ { "rank": 1, "document_id": "string", "authority_type": "Statute | Regulation | Revenue Ruling | Private Letter Ruling | IRS Notice | Publication | Commentary", "title": "string", "effective_date": "YYYY-MM-DD", "applicability_score": 0.0-1.0, "key_excerpt": "relevant quote from document", "reasoning": "why this evidence is ranked here", "flags": ["SUPERSEDED_BY_DOC_X" | "EXPIRED" | "NOT_YET_EFFECTIVE" | "CIRCULAR_REFERENCE" | "CONFLICT_WITH_DOC_Y"] } ], "conflicts": [ { "document_a_id": "string", "document_b_id": "string", "conflict_description": "string", "prevailing_authority": "document_id of prevailing authority", "resolution_rationale": "string" } ], "superseded_guidance": [ { "superseded_document_id": "string", "superseding_document_id": "string or null if not in retrieved set", "supersession_evidence": "quote or explanation" } ], "circular_references": [ { "document_a_id": "string", "document_b_id": "string", "description": "string" } ], "gaps": ["list of missing authority types or unanswered sub-questions"], "overall_confidence": 0.0-1.0 } ## TAXPAYER_CONTEXT [TAXPAYER_CONTEXT] ## EXAMPLES [FEW_SHOT_EXAMPLES]
To adapt this template, replace the square-bracket placeholders with your runtime data. [QUERY] should contain the user's tax question. [RETRIEVED_DOCUMENTS] should contain the full text and metadata of each retrieved document, including document IDs, titles, dates, and authority types. [TAXPAYER_CONTEXT] must include jurisdiction, entity type, tax year, and relevant facts. [FEW_SHOT_EXAMPLES] should contain 2-3 worked examples showing correct ranking, conflict resolution, and flagging behavior. If your retrieval system does not provide document IDs, generate them from a hash of the document content before calling the prompt.
Before deploying, validate the output against the schema using a JSON schema validator. Run eval suites that include known superseded documents, circular references, and jurisdiction mismatches. If the model fails to flag a known superseded document or misses a circular reference, add that case to your few-shot examples. For high-stakes tax workflows, route outputs with overall_confidence below 0.7 or with unresolved conflicts to a human reviewer before surfacing them to users. Do not rely on this prompt alone for final tax positions—always require human review for interpretive guidance and PLR applicability determinations.
Prompt Variables
Required inputs for the Tax Authority Evidence Ranking Prompt Template. Each variable must be populated before the prompt is assembled. Missing or malformed inputs are the most common cause of ranking failures in production.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[TAX_QUERY] | The user's tax question or scenario to be answered | Are software development costs for a SaaS platform eligible for R&D amortization under Section 174 for a Delaware C-Corp in 2024? | Must be non-empty string. Check for ambiguous entity types or missing tax years. If jurisdiction is implied but not stated, flag for clarification before ranking. |
[RETRIEVED_AUTHORITIES] | Array of retrieved tax authority documents with metadata | [{"doc_id":"IRC_174_2024","title":"Internal Revenue Code Section 174","type":"statute","jurisdiction":"federal","effective_date":"2022-01-01","text":"..."}] | Each object must include doc_id, type, jurisdiction, and effective_date. Null or missing effective_date triggers staleness flag. Type must be from controlled vocabulary: statute, regulation, ruling, procedure, notice, case_law, treaty, guidance, or other. |
[TAXPAYER_PROFILE] | Structured object describing the taxpayer's relevant attributes | {"entity_type":"C-Corporation","jurisdiction":"Delaware","filing_status":"domestic","tax_year":2024,"industry":"technology"} | Entity_type and jurisdiction are required. Tax_year must be integer. Validate jurisdiction against known tax authority list. Missing industry may reduce applicability scoring accuracy. |
[JURISDICTION_PRIORITY] | Ordered list of jurisdictions by authority precedence for this query | ["federal","Delaware","multistate"] | Must be non-empty array. Federal should typically appear first for US tax queries unless query is explicitly state-only. Validate each entry against known jurisdiction codes. Mismatch with taxpayer jurisdiction triggers warning. |
[AUTHORITY_HIERARCHY] | Ranked list of authority types from strongest to weakest for this domain | ["statute","regulation","ruling","procedure","notice","case_law","guidance"] | Must be non-empty array. Validate all entries against controlled authority type vocabulary. Hierarchy should reflect tax domain norms: statutes and regulations above administrative guidance. Custom hierarchies require domain expert approval. |
[EFFECTIVE_DATE_CUTOFF] | Date before which authorities are considered potentially superseded | 2020-01-01 | ISO 8601 date string. Authorities with effective_date before cutoff receive staleness penalty but are not automatically excluded. Null allowed if no cutoff desired, but triggers warning in eval. Must be before current date. |
[OUTPUT_SCHEMA] | Expected structure for the ranked evidence output | {"ranked_authorities":[{"doc_id":"string","rank":"integer","score":"float","authority_level":"string","relevance_rationale":"string","staleness_flag":"boolean","supersession_risk":"string"}]} | Must be valid JSON Schema or example structure. Validate that required fields include doc_id, rank, score, and relevance_rationale. Missing staleness_flag or supersession_risk fields will cause eval to skip critical checks. |
[CROSS_REFERENCE_MAP] | Mapping of doc_ids to their cited authorities for circular reference detection | {"IRC_174_2024":["Treas_Reg_1.174-2","Notice_2023-63"],"Notice_2023-63":["IRC_174_2024"]} | Optional but strongly recommended. If provided, harness must detect cycles where A cites B and B cites A. Missing map disables circular reference detection. Validate that all referenced doc_ids exist in RETRIEVED_AUTHORITIES. |
Implementation Harness Notes
Wire the tax authority evidence ranking prompt into a production RAG pipeline with validation, retries, logging, and human review gates.
This prompt is designed to operate as a stateless ranking microservice within a larger RAG pipeline. It expects pre-retrieved passages with complete metadata as input and does not perform document retrieval itself. The calling application is responsible for assembling the [RANKED_EVIDENCE] array, ensuring each passage object contains the required fields (passage_id, text, jurisdiction, authority_type, effective_date, cross_references) before the model call. Any missing or malformed fields must trigger a pre-call validation error that halts the workflow and returns a structured error to the upstream retriever, not a degraded prompt to the model.
After the model returns a ranked evidence brief, run a post-processing validator that checks for superseded guidance. This validator must compare effective_date values across passages and flag any source that has been explicitly overridden by a later authority of equal or higher level within the same jurisdiction. It must also detect circular cross-reference chains (e.g., Ruling A cites Ruling B, which cites Ruling A) and mark those passages for human review. The validator should output a validity_flags array alongside the ranked brief, with each flag linked to a specific passage_id and a machine-readable reason code (SUPERSEDED, CIRCULAR_REF, JURISDICTION_MISMATCH).
Every ranking decision must be logged for auditability. Capture the model version, a SHA-256 hash of the prompt template, the full list of input passage IDs, the ranked output order, and any validity flags in a structured log entry. Store these logs in an append-only datastore with a retention period matching your organization's audit requirements. For high-stakes tax positions—defined as any ranking involving penalty exposure, statute of limitations analysis, or positions contrary to published IRS guidance—route the ranked evidence brief to a human tax professional via a review queue before it reaches the end user. The review interface should display the ranked passages, validity flags, and a diff view showing which passages the model deprioritized and why.
Implement a retry loop with exponential backoff for malformed JSON outputs. If the model response fails JSON schema validation, retry up to three times with backoff intervals of 1s, 4s, and 16s. On each retry, append a brief repair instruction to the prompt context indicating the specific schema violation. After three failed retries, escalate to a human queue with the full prompt payload, the failed outputs, and the validation error log. Do not silently fall back to an unranked passage list or a degraded response. For model selection, prefer models with strong JSON mode and structured output support (e.g., GPT-4o with response_format, Claude 3.5 Sonnet with tool-use mode). Avoid models that require fragile regex post-processing for JSON extraction.
Expected Output Contract
Define the exact shape of the model response so downstream parsers, validators, and UI components can rely on a stable contract. Each row specifies a field, its type, whether it is required, and the validation rule to apply before the output is considered acceptable.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
evidence_brief | Array of objects | Schema check: array length >= 1. Each object must have the keys 'rank', 'source_id', 'authority_score', and 'reasoning'. | |
evidence_brief[].rank | Integer | Parse check: must be a positive integer starting at 1. Sequence check: ranks must be consecutive without gaps. | |
evidence_brief[].source_id | String | Citation check: must match a [SOURCE_ID] provided in the input context. Null or fabricated IDs must trigger a retry. | |
evidence_brief[].authority_score | Float | Range check: must be between 0.0 and 1.0 inclusive. If null, treat as a validation failure. | |
evidence_brief[].reasoning | String | Content check: must reference at least one of jurisdiction, authority level, effective date, or taxpayer applicability from the source metadata. Empty string is a failure. | |
superseded_guidance_flags | Array of strings | Schema check: must be an array. Each element must be a [SOURCE_ID] from the input. If empty, the array must be present but empty, not null or omitted. | |
circular_reference_flags | Array of strings | Schema check: must be an array. Each element must be a [SOURCE_ID] from the input. If empty, the array must be present but empty, not null or omitted. | |
overall_assessment | String | Content check: must contain a concise summary of the evidence hierarchy. Null or empty string is a failure. Approval required if assessment contradicts the ranked order. |
Common Failure Modes
Tax authority evidence ranking fails in predictable ways. These are the most common production failure modes and the guardrails that catch them before they reach users.
Superseded Guidance Goes Undetected
What to watch: The model ranks a revenue ruling or IRS notice as authoritative without checking whether it has been superseded, revoked, or modified by later guidance. This produces legally incorrect rankings that cite dead law. Guardrail: Include an explicit effective_date and superseded_by check step in the prompt. Cross-reference each retrieved authority against a supersession database or require the model to flag any source older than the most recent major tax act without explicit revalidation.
Circular Cross-References Create Authority Loops
What to watch: Two or more sources cite each other as primary authority, creating a circular dependency that inflates both scores. The model treats each as independently authoritative when neither has external grounding. Guardrail: Add a dependency-graph check that requires at least one source in any authority chain to be grounded in statute, regulation, or judicial precedent rather than another administrative interpretation. Flag circular reference clusters for human review.
Jurisdiction Mismatch Produces Irrelevant Rankings
What to watch: The model ranks federal guidance against a state tax question, applies California FTB rulings to a New York taxpayer, or mixes international tax treaty provisions with domestic code sections. Guardrail: Extract the taxpayer's jurisdiction explicitly from the input context. Add a jurisdiction-filtering step before ranking that discards or down-weights sources from non-matching jurisdictions. Include a jurisdiction-match confidence field in the output schema.
Taxpayer-Specific Applicability Is Ignored
What to watch: The model ranks evidence by general authority level without considering whether the ruling, regulation, or guidance actually applies to the taxpayer's entity type, industry, transaction type, or filing status. A C-corp ruling gets top-ranked for an S-corp question. Guardrail: Require the prompt to extract taxpayer profile fields (entity type, industry, filing status, transaction type) and add an applicability-filtering step. Each ranked source must include a brief applicability rationale that references specific taxpayer attributes.
Effective Date Sequencing Is Wrong
What to watch: The model ranks a source as authoritative for a tax year before the guidance was effective, or applies expired provisions to current-year questions. Temporal misalignment produces rankings that look authoritative but are factually inapplicable. Guardrail: Include the tax year or transaction date in the input context. Add an effective-date validation step that checks whether each source was in effect during the relevant period. Flag any source with an effective date after the tax year in question.
Administrative Guidance Outranks Statute
What to watch: The model ranks an IRS publication, FAQ, or informal guidance above the Internal Revenue Code or Treasury Regulations because the administrative source is more specific or easier to read. This inverts the actual legal authority hierarchy. Guardrail: Hard-code the authority hierarchy in the prompt instructions: Constitution > Statute (IRC) > Treasury Regulations > Revenue Rulings > Revenue Procedures > Private Letter Rulings (non-precedential) > IRS Publications > IRS FAQs. Require the model to justify any deviation from this hierarchy.
Evaluation Rubric
Criteria for testing the quality of ranked tax authority evidence before shipping. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Jurisdiction Match | All ranked sources match the taxpayer's identified jurisdiction. | A federal circuit court ruling is ranked for a state-level question without explanation. | Assertion-based eval: For each source in the top 5, check that [TAXPAYER_JURISDICTION] matches the source's jurisdiction field. |
Authority Hierarchy | Higher-ranked sources are from a higher level in the tax authority hierarchy (e.g., IRC above Regs above Rulings). | A Private Letter Ruling is ranked above a Treasury Regulation for a general applicability question. | Pairwise comparison eval: For 20 random pairs in the output, verify the higher-ranked source has a strictly greater [AUTHORITY_LEVEL] score. |
Effective Date Relevance | Superseded or expired guidance is either excluded or ranked last with a clear 'superseded' tag. | A revenue ruling explicitly obsoleted by a later ruling is ranked in the top 3 without a warning. | Golden dataset test: Include a known superseded document in the retrieval set. Check that its [EFFECTIVE_STATUS] is 'superseded' and its rank is below all active sources. |
Taxpayer-Specific Applicability | Sources relevant to the taxpayer's entity type and fact pattern are ranked higher than general sources. | A C-corp ruling is ranked highest for an S-corp taxpayer question. | Scenario test: Run the prompt with [TAXPAYER_ENTITY_TYPE] set to 'S-Corp'. Assert that the top-ranked source's [APPLICABLE_ENTITY] field includes 'S-Corp'. |
Circular Reference Detection | No source is ranked based primarily on another source in the same ranked list without that dependency being explicit. | Source A cites Source B, and Source B cites Source A, and both are ranked highly without a cross-reference flag. | Graph traversal check: Parse the [CROSS_REFERENCES] field for all sources. Flag any cycle in the top 10 sources. |
Superseded Guidance Flagging | Any source that has been explicitly superseded, revoked, or obsoleted is flagged in the output. | A Treasury Decision that amended a regulation is presented as the current, standalone authority. | Schema validation: Assert that for every source where [EFFECTIVE_STATUS] is 'superseded', the [WARNING_FLAG] field is not null and contains a reference to the superseding document. |
Reasoning Traceability | The justification for each source's rank is traceable to a specific attribute (authority, date, applicability), not a vague statement. | The justification says 'This is a relevant source' without citing a specific attribute. | LLM-as-judge eval: For each ranked source, prompt a judge model to confirm that the [RANKING_RATIONALE] references at least one concrete attribute from the source metadata. |
Abstention on Insufficient Evidence | If no retrieved source meets a minimum authority and relevance threshold, the output abstains rather than ranking weak sources highly. | An irrelevant IRS FAQ page is ranked first because it's the only document containing a keyword. | Threshold test: Inject a retrieval set containing only low-authority sources (e.g., blog posts, FAQs). Assert that the output's [EVIDENCE_SUFFICIENCY] field is 'insufficient' and the ranked list is empty. |
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 flat list of retrieved documents. Use a simple JSON output schema with authority_level, effective_date, and relevance_score fields. Skip jurisdiction-specific ranking logic initially—focus on getting the model to identify document types (statute, ruling, guidance) and extract dates correctly.
Add a lightweight instruction: If you cannot determine the effective date, set effective_date to null and set confidence to low.
Prompt snippet
codeRank the following retrieved tax documents by authority and applicability for [TAXPAYER_SITUATION]. Documents: [RETRIEVED_DOCUMENTS] Output a JSON array with: document_id, authority_level (statute|regulation|ruling|guidance|other), effective_date, relevance_score (1-5), reasoning.
Watch for
- Confusing publication date with effective date
- Treating all IRS guidance as equal weight
- Missing taxpayer-specific applicability entirely
- No handling of superseded documents

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