This prompt is designed for technical writing teams, security engineers, and API product managers who need to systematically audit an existing set of authentication and authorization documentation. The core job-to-be-done is to move from a subjective feeling that 'the docs might be incomplete' to a structured, prioritized audit report that flags specific gaps—such as missing grant types, undocumented error codes, stale code samples, or contradictory instructions across pages. The ideal user is someone responsible for documentation quality who needs an automated first pass before a manual deep-dive, not a replacement for human security review.
Prompt
Auth Documentation Completeness Audit Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Auth Documentation Completeness Audit Prompt.
Use this prompt when you have a collection of auth documentation pages (OAuth flows, API key guides, session management, scope references) and you need a completeness audit against a known standard like an RFC, an OpenAPI spec, or an internal auth policy. The prompt requires you to provide the documentation content as [DOCUMENTATION_PAGES], a reference specification as [AUTH_STANDARD], and an optional [AUDIT_CRITERIA] list to focus the audit on specific dimensions such as error handling, code sample freshness, or terminology consistency. The output is a structured report with severity classifications (Critical, High, Medium, Low) and fix prioritization, making it directly usable as a sprint planning input.
Do not use this prompt for real-time auth debugging, live traffic analysis, or as a substitute for a penetration test. It audits documentation, not running systems. Avoid using it on a single page in isolation—the value comes from cross-page consistency checks and gap analysis against a reference standard. If your documentation is auto-generated from an OpenAPI spec, this prompt is better suited for auditing the surrounding conceptual guides, quickstarts, and troubleshooting pages rather than the reference itself. For high-risk auth flows involving financial transactions or health data, always follow the automated audit with a manual security review and consider pairing this prompt with the OAuth 2.0 Error Response Reference Generation Prompt to fill any error catalog gaps identified.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before running it.
Good Fit: Multi-Page Auth Audits
Use when: you have a documentation site with 5+ pages covering OAuth flows, API key management, scopes, and error references. The prompt excels at finding contradictions across pages (e.g., token lifetime stated as 3600s on one page and 1800s on another). Guardrail: Provide a clear page inventory with URLs or section identifiers so the model can cite specific locations.
Good Fit: Pre-Release Documentation QA
Use when: auth docs are complete in draft but haven't shipped. The prompt catches missing error codes, undocumented grant types, and stale code samples before customers hit them. Guardrail: Run this against a staging or branch build, not live docs, to avoid flagging intentionally unpublished changes.
Bad Fit: Single-Page or Sparse Docs
Avoid when: you have only one auth page or minimal API reference. The prompt relies on cross-page comparison to find contradictions and gaps. With insufficient surface area, it produces low-signal findings. Guardrail: Use a simpler completeness checklist prompt for single-page reviews.
Bad Fit: Runtime Auth Behavior Validation
Avoid when: you need to verify that the live API actually behaves as documented. This prompt audits documentation text, not running systems. It cannot detect if the token endpoint returns a different error code than documented. Guardrail: Pair with integration tests that validate documented behavior against the live API.
Required Inputs
You must provide: the full text of all auth-related documentation pages, a list of documented grant types, the complete set of API endpoints requiring auth, and any known scope definitions. Guardrail: If you omit the scope catalog, the prompt cannot flag endpoints missing scope requirements. Pre-assemble these inputs before running the audit.
Operational Risk: False Positives on Intentional Gaps
Risk: the prompt may flag missing documentation for features that are intentionally undocumented (internal-only endpoints, deprecated flows). Guardrail: Provide an exclusion list of known intentional gaps before running the audit. Review all severity classifications manually before publishing findings.
Copy-Ready Prompt Template
A reusable prompt template for auditing auth documentation completeness, ready to copy and adapt with your own inputs.
This prompt template is the core of the Auth Documentation Completeness Audit. It is designed to be copied directly into your AI harness, with square-bracket placeholders that you replace with your specific documentation content, evaluation criteria, and output requirements. The template instructs the model to act as a thorough technical reviewer, systematically checking for missing grant types, undocumented error codes, stale code samples, and contradictory instructions across pages. It produces a structured audit report with severity classification and fix prioritization, making it actionable for technical writing teams.
textYou are an expert technical documentation auditor specializing in authentication and authorization systems. Your task is to perform a completeness audit on the provided auth documentation. ## INPUT DOCUMENTATION [INPUT] ## AUDIT CRITERIA Review the documentation against the following completeness dimensions: - **Grant Types and Flows**: Are all applicable OAuth 2.0 grant types, API key schemes, session-based auth, and token exchange patterns fully documented? Flag any missing flows. - **Error Codes and Responses**: Are all possible error responses documented with HTTP status codes, error body schemas, and resolution steps? Check against the OAuth 2.0 RFC error registry and common implementation errors. - **Code Samples**: Are all code samples syntactically correct, using current library versions, and free of security anti-patterns (hardcoded secrets, localStorage for tokens, missing PKCE)? - **Cross-Page Consistency**: Do parameter names, endpoint URLs, scope strings, and token lifetime values match across all pages? Flag any contradictions. - **Security Considerations**: Are token storage best practices, CSRF protection, PKCE requirements, rate limiting, and secret rotation documented? - **Scope Definitions**: Is every scope defined with its exact permissions and the endpoints it unlocks? Check for undocumented scopes or over-scoped examples. - **Token Lifecycle**: Are token creation, refresh, expiration, revocation, and rotation fully documented with exact lifetimes and renewal procedures? ## OUTPUT FORMAT Produce a structured JSON audit report with the following schema: [OUTPUT_SCHEMA] ## CONSTRAINTS [CONSTRAINTS] ## EXAMPLES Here are examples of findings at different severity levels: [EXAMPLES] ## RISK LEVEL [RISK_LEVEL] For each finding, include: 1. **Severity**: critical, high, medium, or low 2. **Category**: grant_type, error_code, code_sample, consistency, security, scope, token_lifecycle, or other 3. **Location**: specific page, section, or code block reference 4. **Description**: what is missing, incorrect, or contradictory 5. **Impact**: what breaks or what security risk exists if this is not fixed 6. **Fix Recommendation**: specific, actionable guidance for the writer 7. **Priority Score**: 1-10 based on user impact and security risk Group findings by severity and sort by priority score within each group. Include a summary section with counts by severity and category.
To adapt this template, replace the square-bracket placeholders with your specific content and requirements. [INPUT] should contain the full text of your auth documentation, ideally concatenated from multiple pages with clear section markers. [OUTPUT_SCHEMA] should specify the exact JSON structure you want, including field names, types, and whether fields are required. [CONSTRAINTS] can include page limits, specific OAuth flows to focus on, or style guide rules to enforce. [EXAMPLES] should provide 2-3 example findings at different severity levels to calibrate the model's judgment. [RISK_LEVEL] should indicate the deployment context (e.g., production auth system, pre-launch review, compliance audit) to help the model calibrate severity appropriately. After copying the template, test it against a known-good documentation set to verify the output structure matches your expectations before running it on real docs.
Prompt Variables
Placeholders required by the Auth Documentation Completeness Audit Prompt. Each variable must be populated before the audit run to ensure the model has the target documentation, evaluation criteria, and output schema.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[AUTH_DOCS] | Full text of all authentication documentation pages to audit | All pages from /docs/auth/* concatenated with page titles and URLs | Must be non-empty plain text or markdown. Validate character count > 100. If multiple pages, prepend each with 'PAGE: <title> URL: <url>' separator. |
[AUTH_TYPE] | Expected authentication mechanism(s) covered by the docs | OAuth 2.0 Authorization Code Grant with PKCE, API Key in Header | Must be a comma-separated list of grant types or auth methods. Validate against known auth type taxonomy. If null, model will infer from docs but may miss gaps. |
[SCOPE_CATALOG] | Complete list of scopes or permissions the system supports | read:users, write:orders, admin:settings, read:reports | Must be a comma-separated list or JSON array. Validate each scope appears in at least one endpoint mapping in [AUTH_DOCS]. Empty list triggers scope coverage check failure. |
[ENDPOINT_LIST] | All API endpoints requiring authentication | GET /users, POST /orders, DELETE /sessions | Must be a comma-separated list or JSON array of HTTP method + path pairs. Validate format matches 'METHOD /path'. Used to cross-check scope-per-endpoint mapping completeness. |
[ERROR_CODE_REGISTRY] | Known auth error codes from implementation or RFC | invalid_grant, invalid_client, invalid_token, expired_token, insufficient_scope | Must be a comma-separated list. Validate against OAuth 2.0 RFC 6749 error registry if applicable. Empty list means model checks docs against common errors only. |
[OUTPUT_SCHEMA] | Desired structure for the audit report | JSON object with findings array, severity field, fix_priority field, and page_reference field per finding | Must be a valid JSON Schema or example object. Validate parseable JSON. Model will use this to format each finding with required fields. |
[SEVERITY_RUBRIC] | Criteria for classifying finding severity | CRITICAL: missing grant type or broken code sample; HIGH: undocumented error code; MEDIUM: stale example; LOW: style inconsistency | Must be a text description or JSON mapping severity levels to conditions. Validate non-empty. If null, model uses default severity logic which may not match team priorities. |
Implementation Harness Notes
How to wire the Auth Documentation Completeness Audit Prompt into an application or workflow.
This prompt is designed to be run as a batch job against a set of documentation pages, not as a real-time chat interaction. The primary integration point is a script or CI/CD pipeline that iterates over a list of URLs or file paths, sends each document's content as the [DOCUMENTATION_CONTENT] input, and collects the structured audit reports. Because the output is a JSON object with a severity classification, the harness should parse each response and aggregate findings into a dashboard or issue tracker. The model choice matters: use a model with strong instruction-following and structured output capabilities (e.g., GPT-4o, Claude 3.5 Sonnet) and set temperature to 0 to maximize consistency across pages.
The implementation harness must enforce the output schema before accepting a result. Wrap the model call in a validation layer that checks for the required top-level keys (document_title, audit_date, findings, overall_score), verifies that each finding has a valid severity enum value (critical, high, medium, low), and confirms that overall_score is an integer between 0 and 100. If validation fails, implement a single retry with the validation error message appended to the prompt as additional [CONSTRAINTS]. Log every validation failure and retry attempt for observability. For high-stakes documentation (e.g., OAuth grant types, token storage guidance), route findings with critical or high severity to a human review queue before they are published to the engineering team.
To scale this across a large doc set, build a simple orchestrator that reads a manifest of document paths, sends each through the prompt, and writes the validated JSON output to a structured store (e.g., a database or a directory of JSON files). Use the overall_score field to sort pages by risk, and generate a summary report that lists every critical finding across all documents. Avoid running this prompt on pages that are not authentication-related, as the evaluation criteria are tuned for grant types, error codes, token flows, and scope definitions. For ongoing use, integrate the harness into your documentation CI pipeline so that every PR touching auth docs triggers a completeness audit on the changed files, blocking merges if new critical findings are introduced.
Expected Output Contract
Define the exact fields, types, and validation rules your application must enforce on the model's JSON output. Use this contract to build a post-processing validator before the audit report enters any downstream system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
audit_id | string (UUID v4) | Must match regex ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ | |
audit_timestamp | string (ISO 8601) | Must parse to a valid UTC datetime within the last 24 hours | |
document_uri | string (URI) | Must be a valid absolute URI matching the input [DOCUMENT_URI] exactly | |
findings | array of objects | Must contain at least 1 item; empty array is a validation failure | |
findings[].severity | enum string | Must be one of: critical, high, medium, low | |
findings[].category | enum string | Must be one of: missing_grant_type, undocumented_error_code, stale_code_sample, contradictory_instruction, missing_security_consideration, broken_link | |
findings[].location | string | Must be a non-empty string referencing a specific section heading or line number from the source document | |
findings[].evidence | string | Must be a non-empty direct quote from the source document; null or paraphrased text is a validation failure | |
findings[].recommendation | string | Must be a non-empty actionable instruction; generic text like 'fix this' is a validation failure | |
coverage_summary | object | Must contain grant_types_covered, error_codes_covered, and code_samples_audited as integers >= 0 |
Common Failure Modes
What breaks first when auditing auth documentation and how to guard against it.
Surface-Level Checklisting
What to watch: The model produces a generic checklist that confirms the presence of sections without evaluating their correctness. It counts headings but misses that the token refresh flow describes an insecure grant type. Guardrail: Require the prompt to cite specific contradictions, missing parameters, or stale code samples. Add an eval that checks whether the audit report contains at least one concrete technical finding per audited page.
Stale Code Sample Blindness
What to watch: The model treats documented code samples as ground truth even when they use deprecated SDK methods, hardcoded secrets, or insecure storage patterns. It won't flag localStorage.setItem('token') unless explicitly instructed. Guardrail: Include a dedicated check in the prompt for known anti-patterns (localStorage, hardcoded keys, missing HttpOnly flags). Pair with a static analysis tool for code blocks when possible.
Cross-Page Contradiction Drift
What to watch: The model audits each page in isolation and misses contradictions across pages—such as one page requiring a scope that another page marks as optional, or conflicting token lifetime values. Guardrail: Structure the prompt to require a cross-reference pass. Ask the model to extract all scopes, lifetimes, and endpoints into a table first, then flag inconsistencies. Use a separate eval that counts cross-page citations in the final report.
Error Code Registry Gaps
What to watch: The model lists documented error codes but fails to flag missing standard OAuth errors (invalid_grant, unauthorized_client) or undocumented HTTP status codes that the API actually returns. It audits what's present, not what's absent. Guardrail: Provide the expected error code registry (RFC or internal spec) as grounding context. Instruct the model to produce a diff between expected and documented error codes. Flag any undocumented 4xx/5xx responses.
Severity Inflation or Deflation
What to watch: The model either marks every missing comma as critical or classifies a missing PKCE warning as low severity. Without clear severity criteria, prioritization becomes unreliable. Guardrail: Define severity levels explicitly in the prompt: Critical (auth bypass, token leak), High (missing security guidance, broken flow), Medium (incomplete parameter tables, stale examples), Low (formatting, style). Require justification for every Critical or High finding.
Fix Recommendation Vagueness
What to watch: The audit report says 'improve token storage documentation' without specifying what's wrong or what the fix should say. The finding is accurate but not actionable. Guardrail: Require each finding to include: the exact location (page, section, line), the specific problem, a concrete before/after recommendation, and the affected consumer workflow. Test with an eval that rejects findings without a location and a suggested fix.
Evaluation Rubric
Use this rubric to evaluate the quality of the audit report generated by the Auth Documentation Completeness Audit Prompt before shipping it to the technical writing team. Each criterion targets a specific failure mode common in documentation audits.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Grant Type Coverage | Every grant type mentioned in any doc page is listed in the audit with its documentation status. | A grant type implemented in code but missing from docs is not flagged. | Diff the audit's grant type list against a manual grep of the codebase's auth configuration. |
Error Code Completeness | The audit flags every error code referenced in the API spec that is absent from the troubleshooting guide. | An error code defined in the OpenAPI spec is missing from the audit's 'Undocumented Error Codes' section. | Parse the OpenAPI spec for error responses and cross-reference with the audit report's findings. |
Code Sample Freshness | The audit identifies code samples that use deprecated SDK methods or mismatched library versions. | A code sample using a deprecated method from the last two major versions is marked as 'Current'. | Run a static analysis script against code samples in the docs and compare deprecation warnings to the audit's severity classification. |
Contradiction Detection | The audit catches conflicting statements about token lifetimes or required scopes across different pages. | Two pages state different TTLs for the same token type, but the audit does not flag a contradiction. | Manually inject a known contradiction into a test doc set and verify the audit report includes it as a high-severity finding. |
Severity Classification Accuracy | Findings are classified as 'Critical', 'High', 'Medium', or 'Low' based on a consistent, documented rubric. | A missing security warning about storing API keys in local storage is classified as 'Low'. | Review a sample of 10 findings and check if the severity aligns with the predefined rubric included in the system prompt. |
Fix Prioritization Logic | The 'Recommended Action' for each finding is ordered by dependency, suggesting foundational fixes before cosmetic ones. | The report suggests fixing a typo in a code comment before documenting a missing OAuth error response. | Trace the dependency chain of the top 5 recommended actions to ensure no action is blocked by a lower-priority item. |
Source Grounding | Every finding includes a citation to the specific document, section, or code file where the issue was observed. | A finding states 'Token refresh flow is incomplete' without linking to the specific page or code reference. | Parse the audit report's findings and check for the presence of a non-empty 'Source' or 'Citation' field in each entry. |
False Positive Rate | The audit does not flag correct, up-to-date documentation as an error. | The report flags a correctly implemented OAuth 2.0 flow as 'missing PKCE' when it's a confidential client. | Have a subject matter expert review a report generated on a known-good documentation set and count the number of invalid findings. |
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
Add structured output schema, severity classification, fix prioritization, and multi-page cross-referencing. Require the model to cite exact line numbers or section headers for every finding.
codeAudit the following auth documentation pages for completeness. Pages: [PAGE_LIST_WITH_CONTENT] Output a JSON audit report with this schema: [OUTPUT_SCHEMA] For each finding, include: - Page and section reference - Severity (critical/high/medium/low) - Missing element type (grant_type, error_code, code_sample, contradiction, stale_reference) - Recommended fix with priority (P0/P1/P2)
Watch for
- Silent format drift in JSON output under high page counts
- Model missing cross-page contradictions when pages are audited independently
- False positives on "stale code samples" when the model doesn't know the current SDK version

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