---
title: "Pentest Report Template Validation With an LLM"
description: "Review an approved template and confirmed findings with a model before rendering: flag missing evidence and leave gaps for the analyst to resolve."
canonical: https://pentestllm.ai/pentest-report-template-validation
generated: 2026-11-27T06:25:49.756Z
source: https://pentestllm.ai/pentest-report-template-validation
base_url: https://api.pentestllm.ai/v1
---

Report template validation

# Checking a report before rendering

Send an approved report template and confirmed, redacted records from an authorized engagement to `orca-zero-1.5-cybersecurity` at https://api.pentestllm.ai/v1 for a draft completeness review before rendering the report. The model reads text and returns text; local code checks required fields and finding IDs, while a person checks every claim and signs off on every finding, so missing evidence stays missing instead of becoming generated prose.

[Prices per token](https://pentestllm.ai/pricing)

[Get a key](https://app.pentestllm.ai/console) [Try it free in the browser](https://pentestllm.ai/playground)

```
from openai import OpenAI

client = OpenAI(base_url="https://api.pentestllm.ai/v1", api_key="sk-ptl-live-…")

reply = client.chat.completions.create(
    model="auto/security",
    messages=[{"role": "user", "content": "Explain this advisory and list what to check on an affected host."}],
)
print(reply.model)  # the build that answered
print(reply.choices[0].message.content)
```

## Check records before rendering

The template is the one the engagement uses, each finding has been confirmed and signed by an analyst, and the report is about to be rendered. The job here is narrower than the work the [report writing](https://pentestllm.ai/pentest-report-writing), [remediation writing](https://pentestllm.ai/pentest-remediation-writing) and [executive summary](https://pentestllm.ai/pentest-executive-summary-ai) pages cover: given a versioned template contract and a list of finding IDs, do the records hold every field and reference the template needs for a clean render, or are there gaps a person must fill first?

This is not another report generator. The model reads the template structure and the supplied records and says which required fields are empty and which finding IDs the template names but the records omit. Code then blocks the final render until a person resolves those gaps.

## Template as a versioned contract

A report template is a structure: sections such as findings, executive summary, remediation and scope, each with required fields such as title, severity, affected assets, description, evidence references, impact, fix and confirmation steps. Define those fields in a schema your team approves, with each field marked required or optional and its expected type. Version the schema so a report rendered months later can be checked against the same contract. The JSON Schema specification documents the keywords for types, required fields, length limits and allowed values.

## Let code check the contract, the model the prose

Split the validation. Code checks that every required field exists, that every finding ID in the records matches one the template expects, and that no extra ID appears. The model reads the template outline and each finding's title, description and fix, then says whether any field reads like a placeholder, whether evidence references point to items in the supplied list, and whether the tone matches the client's approved style. Ask for a `json_schema` reply listing the gaps; the catalog shows `orca-zero-1.5-cybersecurity` accepting `response_format`. In the system prompt, tell the model that findings are confirmed by an analyst, that it must add no asset names, severities or evidence, and that absent fields stay absent.

```
import json

# Input files are approved local records, separate from any model reply.
records = json.load(open("findings.json"))
manifest = json.load(open("approved-manifest.json"))
required_ids = manifest["finding_ids"]
if not isinstance(records, list) or not isinstance(required_ids, list):
    raise ValueError("expected lists")
if any(not isinstance(i, str) or not i for i in required_ids):
    raise ValueError("invalid manifest ID")
ids = [f["id"] for f in records]
if len(set(required_ids)) != len(required_ids) or len(set(ids)) != len(ids):
    raise ValueError("duplicate finding IDs")
if set(ids) != set(required_ids):
    raise ValueError("missing or extra finding IDs")

evidence_ids = set(manifest["evidence_ids"])
gaps = []
for f in records:
    for field in ["title", "severity", "description", "fix"]:
        value = f.get(field)
        if not isinstance(value, str) or not value.strip():
            gaps.append({"finding": f["id"], "field": field})
    refs = f.get("evidence_refs")
    if (not isinstance(refs, list) or not refs
            or any(not isinstance(r, str) or r not in evidence_ids for r in refs)):
        gaps.append({"finding": f["id"], "field": "evidence_refs"})
if gaps:
    print(json.dumps({"status": "blocked", "gaps": gaps}, indent=2))
    raise SystemExit(1)
print("Local checks passed; analyst approval is still required before rendering.")
```

## The model reads for prose completeness

Once code confirms the schema, send the template outline and the finding records to the model. It checks whether descriptions read as finished findings or as placeholder text such as "TODO" or "[details here]", whether evidence references point at items in the supplied evidence list, and whether any claim lacks a supporting reference. The reply names the finding ID and the field for each gap. Keep rendering blocked until a named analyst reviews each reported gap, records its resolution or rejection, and code re-validates the records. The small local validator above performs only structural checks; it does not call a model or render a report.

## Missing evidence stays missing

A gap in the records is not a prompt for invention. If a finding lacks an evidence reference, the validation flags it and the render stops. A person then supplies the missing reference or marks the finding as needing a retest. The model must not fill absent scores, asset names or evidence with its own prose, and the validation step rejects any reply that adds a field the records did not hold. The [rules of engagement](https://pentestllm.ai/tools/rules-of-engagement) and the [files and redaction](https://pentestllm.ai/features/files-and-redaction) page apply to the records as they do to every other step.

## Deterministic renderer from validated records

The renderer takes the validated records and the template and produces the report: one section per finding, the executive summary from the confirmed list, and the remediation table from the fix fields. It escapes every user-controlled string for the output format, because finding titles can contain characters that Markdown or HTML treats as markup. Render only after local checks pass and the named analyst resolves every reported gap and approves the records. Model feedback is advisory and cannot grant approval; store the validation log next to the report.

## 16 security builds, priced per token

USD per million tokens, live on 2026-11-27; `auto/security` bills at the build that answers.

Detected refusals and invalid non-streamed JSON qualify for automatic refunds within the daily cap. [Verify your receipt](https://pentestllm.ai/statements/verify).

| Model | Build | Input $/M | Output $/M | Context | Wire formats |
| --- | --- | --- | --- | --- | --- |
| [Qwen3.8 27B Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity) qwen3.8-27b-cybersecurity | Security | $0.40 | $2.40 | 262K | openai |
| [Uncensored Qwen3.8 27b Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity-uncensored) qwen3.8-27b-cybersecurity-uncensored | Security | $0.40 | $2.40 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity) gemma-4-26b-a4b-it-cybersecurity | Security | $0.4224 | $1.3376 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity (Uncensored)](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity-uncensored) gemma-4-26b-a4b-it-cybersecurity-uncensored | Security | $0.48 | $1.52 | 262K | openai |
| [GLM-5.3 Flash Cybersecurity](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity) glm-5.3-flash-cybersecurity | Security | $0.4935 | $1.645 | 1049K | openai |
| [GLM-5.3 Flash Cybersecurity (Uncensored)](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity-uncensored) glm-5.3-flash-cybersecurity-uncensored | Security | $0.5093 | $1.6975 | 1049K | openai |
| [Red Team (Flash)](https://pentestllm.ai/models/uplink-red-team-flash) uplink-red-team-flash | Security | $0.90 | $3.00 | 1000K | openai |
| [Red Team (Pro)](https://pentestllm.ai/models/uplink-red-team-pro) uplink-red-team-pro | Security | $1.50 | $6.00 | – | openai |
| [OrcaCyber MiniMax M3.1 Flash](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity) minimax-m3.1-flash-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber MiniMax M3.1 Flash (Uncensored)](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity-uncensored) minimax-m3.1-flash-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next (Uncensored)](https://pentestllm.ai/models/orcacyber-qwen3.8-flash-next-uncensored) orcacyber-qwen3.8-flash-next-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity) qwen3.8-flash-next-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [Uncensored Qwen3.8 Flash Next Cybersecurity](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity-uncensored) qwen3.8-flash-next-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [Cyber Frontier](https://pentestllm.ai/models/cyber-frontier) cyber-frontier | Security | $5.25 | $15.75 | 1049K | openai |
| [OrcaCyber Zero 1.5](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity) orca-zero-1.5-cybersecurity | Security | $7.50 | $18.75 | 999K | openai |
| [OrcaCyber Zero 1.5 (Uncensored)](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity-uncensored) orca-zero-1.5-cybersecurity-uncensored | Security | $7.50 | $18.75 | 999K | openai |

[Full price list and tool fees](https://pentestllm.ai/pricing) · [Every model](https://pentestllm.ai/models) · [API docs](https://pentestllm.ai/docs)

## Questions

### Which checks should code perform instead of the model?

Code validates the schema: required fields exist, finding IDs match, no extra IDs appear, and field types and lengths conform. The model reads the prose for placeholder text, unsupported evidence references and missing citations.

### What happens when a required evidence field is empty?

The validation flags it with the finding ID and the field name, the render is blocked, and a named analyst supplies the missing reference or marks the finding for retest. The model does not fill the gap.

### Can template validation certify that a finding is correct?

No. It checks that the records match the template contract and that prose is complete. Correctness of each finding is the analyst's job, recorded when they signed off on it, and the validation does not revisit that decision.

### Does the model write the report?

No. It reads the template structure and the records and says where fields are missing or incomplete. The renderer, which runs only after validation passes, takes the confirmed records and produces the report text.

## Read next

[Pentest report writing Drafting findings, impact, remediation and the executive summary, with client data redacted first.](https://pentestllm.ai/pentest-report-writing) [Remediation section with an LLM The shortest fix, the owner and one plain sentence per confirmed finding, checked against the client’s environment.](https://pentestllm.ai/pentest-remediation-writing) [Executive summary with an LLM One page for leadership from confirmed findings: business risk, themes and what to fix first, edited by the lead.](https://pentestllm.ai/pentest-executive-summary-ai) [Compliance mapping with an LLM A schema-bound draft mapping of confirmed findings to OWASP categories, PCI DSS requirements or SOC 2 criteria, checked against the text.](https://pentestllm.ai/compliance-mapping-ai)

Facts about other products and tools on this page were read from their own pages on 22 November 2026: [JSON Schema specification](https://json-schema.org/specification). They change; check the source before relying on a figure.

## One key, from $3

For systems you own or may test in writing: [acceptable use](https://pentestllm.ai/acceptable-use).

[Get a key](https://app.pentestllm.ai/console)
