
Codegen treats the complete request as untrusted even though the caller is
expected to provide a type-checked model. A hostile source program, inconsistent
AST or type metadata, extreme nesting, crafted JVM names, SQL and HTTP metadata,
and repeated or concurrent requests are in scope. The embedding process,
credentials, filesystem, network, runtime ABI, and integrity of generated
classfiles are protected assets.

## Trust assumptions

The caller supplies a matching `Program` and `TypeInfo`, chooses explicit
resource limits when defaults are unsuitable, and loads generated classes with
the published matching runtime ABI. Codegen does not grant trust merely because
input passed type checking. It still validates identities and budgets and runs
the universal verifier.

Approved build plugins and dependencies are controlled by locks, pinned CI
actions, forbidden-dependency checks, an SPDX SBOM, and OSV scanning. A fully
compromised JDK or build plugin is outside the runtime request threat model, but
it remains part of release supply-chain review.

## Security invariants

Failures are atomic. Successful output has bounded resource use, safe normalized
JVM identities, collision-free artifact paths, deterministic ordering, and valid
ASM dataflow. Production codegen has no filesystem, socket, HTTP client,
environment lookup, or process-global mutation capability. Source identity is
logical metadata and cannot be an absolute path.

Generated persistence values use prepared-parameter paths. Generated HTTP
resources normalize and validate request metadata before handler dispatch.
Generated service clients bind authority at construction, encode path and query
data, reject protected headers and confusing authorities, cap response bodies,
and sanitize failures. Raw SQL remains an explicit separately reviewed language
feature.

## Reporting and patch policy

Do not open a public issue for a suspected vulnerability. Use the private
[security contact form](https://forms.gle/4wGPKwCojhiD5UmX9) and include a minimal
reproducer, affected version, observed diagnostic or artifact, and impact. The
project aims to acknowledge reports within 48 hours and ship a fix or mitigation
within 14 days for confirmed vulnerabilities.

Critical and high findings block a candidate and cannot be waived. Medium
exceptions require a named owner, justification, compensating control, and
expiry. Security fixes receive a new immutable candidate rather than replacing
bytes under an existing version. Promotion to stable is a separate Phase 07
decision.

## Release inspection

Every candidate includes a release manifest, build metadata, compatibility
policy, SPDX SBOM, and checksums computed after assembly. CI scans the staged
dependency graph and rejects absolute workspace paths or forbidden internal
coordinates in publication metadata. Signing, when the publication owner enables
it, happens only after reproducibility checks and does not alter the unsigned
reproducibility claim.
