The Complete Production SOP: How to Deploy and Run PDF/A Long-Term Archival Compliance in Autonomous AI Agents
Step-by-step SOP to install and run PDF/A Long-Term Archival Compliance in Codex, Claude Code, and Cursor. Convert, embed ICC, and validate ISO 19005 standards.
Technical Overview & Architectural Context
Autonomous coding agents like Codex, Claude Code, Cursor, and Windsurf frequently hallucinate or generate non-compliant PDF documents when tasked with document archival. Standard PDF generation pipelines often rely on system font fallbacks, uncalibrated device RGB/CMYK color spaces, and missing or syntactically invalid XMP metadata packets. In legal, financial, and government contexts, ISO 19005 compliance (PDF/A-1b, PDF/A-2b, PDF/A-3b) is legally mandatory; failure to embed glyph subsets or omitting Device-Independent Color Profiles (ICC Output Intents) results in silent rejection by long-term archival repositories. The pdf-a-archival-compliance skill eliminates non-deterministic agent outputs by enforcing rigid procedural boundaries. It mandates full font subset embedding, attaches standardized sRGB or Fogra ICC color profiles, injects validated ISO-compliant XMP metadata blocks, and subjects generated artifacts to deterministic validation checks using the VeraPDF validation engine. This eliminates document degradation across decadal storage cycles and ensures reproducible, automated document pipelines.
Prerequisites & Environment Requirements
Verified Search Intents & Long-Tail Queries Solved
This operational tutorial is engineered to provide deterministic solutions for these developer search queries:
Step-by-Step Execution Playbook
Local Environment Setup & SKILL.md Mounting
Create the local skill manifest directory and inject verified procedural rules into the agent context.
To enable autonomous runtimes (Codex, Claude Code, Cursor, Windsurf) to discover the skill, mount SKILL.md within the global or workspace-level agent skill manifest directory. The runtime scans the frontmatter metadata, registering triggers such as 'convert pdf to pdf-a archival' and configuring security boundaries (restricting shell execution and enforcing workspace-only file writes).
mkdir -p ~/.agents/skills/pdf-a-archival-compliance && curl -fsSL https://askills.dev/api/skills/pdf-a-archival-compliance/raw -o ~/.agents/skills/pdf-a-archival-compliance/SKILL.md---
name: "pdf-a-archival-compliance"
description: "Convert and validate standard PDF documents to PDF/A ISO 19005 long-term archival standards."
metadata:
author: "VeraPDF"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "convert pdf to pdf-a archival"
- "embed icc profile pdf-a"
- "validate pdf-a compliance verapdf"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---Place SKILL.md in the root `.agents/skills/` directory of your repository to ensure it commits with version control, allowing team members and CI bots to share the exact same PDF/A constraints.
Ensure fs_write permissions allow creating artifacts only within the active workspace. Avoid setting absolute file paths outside the sandbox boundaries.
Environment Secrets & Dependency Validation
Verify color profiles and document processing utilities within the execution environment.
PDF/A standards mandate an Output Intent containing a valid ICC profile (e.g., sRGB v2 or v4). Verify that standard ICC profiles and processing tools like Ghostscript or VeraPDF are accessible to the agent in the local environment without requiring elevated root privileges or external network calls.
test -f /usr/share/color/icc/sRGB.icc || curl -fsSL https://www.color.org/sRGB_IEC61966-2-1_black_scaled.icc -o ./assets/sRGB.iccimport pikepdf
def enforce_pdfa(input_path: str, output_path: str, icc_path: str):
with pikepdf.open(input_path) as pdf:
# Attach standardized Output Intent for PDF/A compliance
with open(icc_path, 'rb') as f:
icc_data = f.read()
profile_stream = pdf.make_stream(icc_data)
profile_stream.Type = pikepdf.Name.OutputIntent
profile_stream.S = pikepdf.Name.GTS_PDFA1
profile_stream.OutputConditionIdentifier = pikepdf.String('sRGB')
profile_stream.RegistryName = pikepdf.String('http://www.color.org')
pdf.Root.OutputIntents = pdf.make_indirect([profile_stream])
pdf.save(output_path, force_version='1.4')Cache local ICC profile paths in a repository asset folder rather than fetching over the wire; this complies with `net_access: false` security constraints.
Ghostscript PDF/A conversion without an explicit `PDFA_def.ps` file will silently fall back to standard PDF 1.4/1.7 without PDF/A OutputIntent metadata.
Intent Matching & Trigger Invocation
Dispatch deterministic archival tasks using configured semantic trigger phrases.
When invoking Codex or Claude Code, use the exact keywords defined in the `triggers` array. The agent engine parses these phrases, loads the SOP into system context, and executes the deterministic PDF/A pipeline while adhering to the specified compliance level (PDF/A-1b, PDF/A-2b, or PDF/A-3b).
# In Claude Code CLI or Cursor Chat, prompt:
claude "convert pdf to pdf-a archival on ./dist/invoice.pdf and embed icc profile pdf-a"# Deterministic Ghostscript invocation enforcing ISO 19005-1 (PDF/A-1b)
gs -dPDFA=1 -dBATCH -dNOPAUSE -dNOOUTERSAVE \
-sProcessColorModel=DeviceRGB \
-sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 \
-sOutputFile=workspace/output_pdfa.pdf \
workspace/PDFA_def.ps workspace/input.pdfExplicitly state the PDF/A standard tier in your prompt (e.g., 'PDF/A-2b' for transparency support or 'PDF/A-3b' for embedded XML invoices).
Using vague prompts like 'make this PDF compliant' without trigger words may cause the agent to bypass the skill and write unverified scripts that omit XMP packets.
Verification, Linting & Output Quality Gate
Run automated VeraPDF compliance checks before accepting agent-generated artifacts.
The skill enforces a deterministic post-run quality gate. Before reporting completion, the agent executes the VeraPDF validation engine to inspect font subsets, device colors, and XMP schemas. If any rule fails, the agent self-corrects based on the VeraPDF XML failure report.
verapdf --flavour 1b --format text workspace/output_pdfa.pdf{
"statement": "PASS",
"flavour": "1b",
"rulesChecked": 108,
"rulesFailed": 0,
"details": "Document conforms to ISO 19005-1:2005 Level B standard."
}Ensure CI/CD scripts check `verapdf --success` exit code 0 to automatically fail PRs that contain non-compliant document alterations.
Standard PDF readers (like Preview or Acrobat Reader) displaying a file does not mean it passes ISO 19005. Only formal validators like VeraPDF guarantee archival viability.
Real-World Scenario: Automating ISO 19005-2 (PDF/A-2b) Regulatory Conversion for Financial Audits
“convert pdf to pdf-a archival: Process all quarterly reports in './reports/raw/*.pdf', embed icc profile pdf-a, inject standard XMP metadata with author 'FinCorp Compliance', and validate pdf-a compliance verapdf.”
Runtime Troubleshooting & Failure Modes
Root Cause: The agent generated a PDF without specifying an OutputIntent dictionary in the document Catalog or supplied an uncalibrated generic color profile instead of an ISO-standard ICC profile.
gs -dPDFA=2 -dBATCH -dNOPAUSE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -sOutputFile=fixed.pdf PDFA_def.ps original.pdfRoot Cause: The PDF relies on standard 14 PostScript base fonts (like Helvetica or Times) resolved dynamically by the host viewer. PDF/A strictly forbids non-embedded system font references.
qpdf --stream-data=preserve --re-embed-fonts fixed.pdf fully_embedded_fixed.pdfFrequently Asked Questions (PDF/A Long-Term Archival Compliance SOP)
Q:Can I use PDF/A Long-Term Archival Compliance across Codex, Claude Code, and Cursor simultaneously?
Yes. The skill conforms to the universal SKILL.md specification. Once symlinked or copied into `~/.agents/skills/pdf-a-archival-compliance`, each runtime automatically detects the triggers and enforces the same ISO 19005 conversion rules.
Q:How does PDF/A Long-Term Archival Compliance prevent context window overflow during long agent sessions?
By encapsulating low-level ISO 19005 specifications into four structured SOP steps, the skill avoids re-prompting lengthy font-embedding and ICC parameters. Agents refer directly to deterministic CLI pipelines (Ghostscript, pikepdf, VeraPDF) without inflating prompt token overhead.
Q:Does this skill require escalated root or container permissions?
No. The skill is audited with a security score of 98/100. It disables external network calls (`net_access: false`) and limits file creation strictly to the workspace directory (`fs_write: workspace`), safely preventing host system modification.
Ready to equip your autonomous agent with PDF/A Long-Term Archival Compliance?
Copy the complete audited SKILL.md specification or download the 1-click zip bundle directly from our verified registry.