Archify
Archify Security and Operations: Keep Generated Diagrams Inspectable and Safe
A practical Archify security guide for untrusted JSON, source links, generated HTML/SVG, CI permissions, external assets, and rollback.

What you will learn
- Threat-model Archify inputs and exports
- Design least-privilege CI operations
- Govern semantic claims and incident rollback
Before you start
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
Key takeaways
- Typed JSON, source links, and generated HTML/SVG all need input validation.
- Isolate rendering, restrict egress, and run CI with read-only least privilege.
- Review semantic claims and keep rollback and redacted incident evidence.
Treat authored and agent JSON as input
Archify accepts descriptions or agent-produced typed JSON. Both can contain malformed values, prompt-injection text, oversized labels, dangerous URLs, or claims that do not match the repository. Validate schema, lengths, identifiers, and relationship counts before layout; keep the source revision and human approval separate from the model's narrative.
A source trace should link to an expected, reviewable location. Reject unexpected schemes, path traversal, and links that escape the evidence boundary. If a diagram is public, redact secrets and private topology before rendering rather than relying on viewers not to inspect the HTML.
Harden HTML, SVG, and motion
Self-contained HTML/SVG is convenient but executable. Escape text and attributes, sanitize or remove embedded scripts, restrict external requests, and set safe download content types. Treat finite motion and interaction handlers as code paths that deserve tests, not decoration.
Render in an isolated process with bounded CPU, memory, and output size. A malicious label or graph should fail closed with a clear validation error instead of consuming an unbounded CI runner or producing an artifact that phones home.
Operate CI with least privilege
The generation job usually needs read-only source access and a dedicated artifact directory. Do not grant repository write tokens or cloud credentials to a diagram renderer unless a separately reviewed publishing step requires them. Record skill revision, input revision, validation status, export checksum, and external-request policy in build metadata.
Keep last-good output and a rollback revision. If a new skill or fixture exposes sensitive data, stop publication, remove the artifact from distribution, rotate only affected credentials, and preserve a redacted trace for the incident review.
Govern the meaning, not only the bytes
Security controls cannot prove that a topology is complete or that a source edge is semantically correct. Require a reviewer to approve high-impact diagrams, document unresolved facts, and keep a distinction between observed code, authored assumptions, and generated suggestions. Add regression fixtures for injection text, unsafe URLs, duplicate IDs, and oversized graphs.
Decision guide
| Criterion | Option A | Option B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Implementation steps
- 1
Validate JSON fields, URLs, IDs, lengths, and relationship counts.
- 2
Escape/sanitize HTML and SVG and bound renderer resources.
- 3
Use read-only CI credentials and record revisions, policies, and checksums.
- 4
Rehearse publication stop, selective credential rotation, rollback, and review.
Copy-ready example
archify_security:
input: schema_and_length_validated
source_links: [https_only, allow_list]
renderer: isolated
external_requests: disabled_by_default
ci_token: read_only
artifact: last_good_on_failureFrequently asked questions
Is self-contained SVG automatically safe?
No. Escape content, sanitize attributes/scripts, restrict external requests, and test untrusted labels and links.
Should the renderer have repository write access?
Normally no. Give it read-only source access and publish artifacts in a separately reviewed step.
Sources
- Archify README (captured 2026-08-31)Source checked 2026-08-31
- Archify repositorySource checked 2026-08-31