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.
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 answeredprint(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, remediation writing and executive summary 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 and the 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.
| Wire formats | |||||
|---|---|---|---|---|---|
| Qwen3.8 27B Cybersecurity | Security | $0.40 | $2.40 | 262K | |
| Uncensored Qwen3.8 27b Cybersecurity | Security | $0.40 | $2.40 | 262K | |
| Gemma 4 26B A4B Cybersecurity | Security | $0.4224 | $1.3376 | 262K | |
| Gemma 4 26B A4B Cybersecurity (Uncensored) | Security | $0.48 | $1.52 | 262K | |
| GLM-5.3 Flash Cybersecurity | Security | $0.4935 | $1.645 | 1049K | |
| GLM-5.3 Flash Cybersecurity (Uncensored) | Security | $0.5093 | $1.6975 | 1049K | |
| Red Team (Flash) | Security | $0.90 | $3.00 | 1000K | |
| Red Team (Pro) | Security | $1.50 | $6.00 | – | |
| OrcaCyber MiniMax M3.1 Flash | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber MiniMax M3.1 Flash (Uncensored) | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber Qwen3.8 Flash Next (Uncensored) | Security | $2.00 | $4.00 | 262K | |
| OrcaCyber Qwen3.8 Flash Next | Security | $2.00 | $4.00 | 262K | |
| Uncensored Qwen3.8 Flash Next Cybersecurity | Security | $2.00 | $4.00 | 262K | |
| Cyber Frontier | Security | $5.25 | $15.75 | 1049K | |
| OrcaCyber Zero 1.5 | Security | $7.50 | $18.75 | 999K | |
| OrcaCyber Zero 1.5 (Uncensored) | Security | $7.50 | $18.75 | 999K |
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.