Registry & OCI distribution
The Alquimia Platform registry is a local TinyDB store that holds agent specs, secrets, parameters, tool registrations, shield registrations, knowledge topics, file registrations, and model registrations. Each agentspace maps to a directory on disk and can be packaged as a signed OCI artifact for promotion between environments.
What the registry stores
Section titled “What the registry stores”| Table | Holds |
|---|---|
agents | AssistantConfig JSON documents |
secrets | Secret definitions (name, scope, dtype, required) — never values |
parameters | ParameterDef values for parameterized agents |
tools | ToolRegistration connection config and per-operation classification |
shields | ShieldRegistration reusable classifier connectors |
topics | TopicRegistration bindings to vector-store collections |
files | FileRegistration metadata for topic files |
models | ModelRegistration for reusable LLM connectors |
Secrets are stored as references only. Values are resolved at inference time from environment variables or HashiCorp Vault.
Local layout
Section titled “Local layout”$ALQUIMIA_REGISTRY_DIR/├── metadata.json # agentspace metadata└── <agentspace_id>/ ├── dist.json # current mutable workspace └── <tag>.json # cached immutable versioned snapshotsSet ALQUIMIA_REGISTRY_DIR to change the storage root. In production the registry volume is mounted read/write on the master and read-only on workers (ALQUIMIA_RUNTIME_MODE=worker).
Versioned / “cold” agentspace registries
Section titled “Versioned / “cold” agentspace registries”Versioned registries let you load and run a specific OCI tag without changing the workspace dist.json. This is useful for reproducible inference, safe promotion, and running older snapshots side-by-side.
How it works
Section titled “How it works”AlquimiaRegistry.load_version(agentspace_name, tag=None, ...)loads a cached<tag>.jsonsnapshot or pulls it from OCI into an isolated temporary directory, then points the registry at that snapshot. The localdist.jsonstays unchanged.parse_versioned_ref()returns aVersionedReffor strings like<agentspace>/<assistant>[:<tag>].resolve_versioned_ref()is a public helper inalquimia.corethat returns a loaded registry plus assistant id.
When a snapshot is loaded into a different agentspace, foreign agentspace_id values in topic and file registrations are rebound to the local namespace. This keeps cloned agentspaces pointing at their own collections instead of the source agentspace’s.
Security
Section titled “Security”_validate_cache_tag() rejects path separators and parent-directory references (for example, ../foo), so version tags cannot escape the agentspace directory. list_cached_versions() skips symlinks and unsafe filenames.
See the CLI reference for alquimia registry fetch --tag, alquimia registry versions, alquimia registry flush-version, and alquimia local exec/chat <agentspace>/<assistant>[:<tag>].
Encryption at rest
Section titled “Encryption at rest”Set ALQUIMIA_REGISTRY_KEY to enable transparent AES-256-GCM encryption of all TinyDB JSON files. The key is a Base64-encoded AES-256 key, typically sourced from Vault.
- Encryption protects against volume or bucket exposure.
- It does not protect against a compromised runtime process, which can read decrypted data through normal registry APIs.
- Use
ALQUIMIA_RUNTIME_MODE=workerfor inference pods so the registry is read-only. - The ciphertext envelope stores a
kidfield fromALQUIMIA_REGISTRY_KEY_ID(defaultdefault) for key rotation. - If
ALQUIMIA_REGISTRY_KEYis absent, the registry stores plaintext.
OCI distribution
Section titled “OCI distribution”Agentspaces can be published to and pulled from any OCI registry (Docker Hub, GHCR, ECR, Harbor, a private ORAS registry, etc.). The registry uses the ORAS CLI under the hood.
Publishing namespace
Section titled “Publishing namespace”The OCI path an agentspace publishes to is a property of the deployment, not of the agentspace metadata. The published repo_id is:
<ALQUIMIA_OCI_REGISTRY_DEFAULT>/<ALQUIMIA_OCI_NAMESPACE_AGENTSPACES>/<name>| Variable | Default | Description |
|---|---|---|
ALQUIMIA_OCI_REGISTRY_DEFAULT | ghcr.io | Default registry host |
ALQUIMIA_OCI_NAMESPACE_AGENTSPACES | agents | Deployment namespace for agentspace artifacts and their index anchor |
Boltzmann brain artifacts use their own OCI namespace. See Gaussia / Boltzmann brains for details.
RepositoryMetadata.namespace does not take part in the published path; OCIRepoID.namespace is used for parsing general foreign references. alquimia registry create has no --namespace flag, and -n / --namespace means the agentspace everywhere.
A consequence of <namespace>/<name> being the natural key:
- Name collisions fail loudly. An identical re-publish passes (compared by layer digest). Replacing an artifact whose
ai.alquimia.registry.authorannotation matches the publisher also passes when the existing manifest’s signature verifies; unsigned author claims are not trusted. Anything else is treated as two agentspaces sharing a name and is refused unless you pass--force/force=True.
Layer media types
Section titled “Layer media types”| Media type | Content | Included by default |
|---|---|---|
application/vnd.alquimia.registry.dist.v1+json | Complete dist.json | Yes |
application/vnd.alquimia.registry.dist.public.v1+json | Public layer | Pull only |
application/vnd.alquimia.registry.dist.private.v1+json | Private layer | Pull only |
application/vnd.alquimia.registry.index.entry.v1+json | Index catalog entry (repo, tag, digest, kind, metadata) | With ALQUIMIA_OCI_INDEX_ENABLED=true |
By default the secrets table is excluded from pushes. Pass --include-secrets to also push secret metadata (key, scope, dtype, required — never values) as a separate dist.private.json layer. The public layer becomes dist.public.json. Pulling reassembles both layers back into a single local dist.json.
Encrypted-registry push behavior
Section titled “Encrypted-registry push behavior”If the local dist.json is encrypted, push() creates temporary plaintext copies for the OCI layers. The remote artifact is standard, unencrypted JSON so external consumers can read it without your AES key. The local file stays encrypted and temporary plaintext files are deleted after the ORAS transfer.
External publish targets and promotion
Section titled “External publish targets and promotion”You can publish to a repository outside the deployment namespace (--target oci.example.com/acme/agents/production) or copy an already-published artifact to another target with alquimia registry promote. External targets are authorized through the registry ACL, and promote reads the source manifest by digest from the namespace index so it does not re-serialize from the local workspace.
# Publish to an external repositoryalquimia registry publish --namespace production --tag v1.2.0 \ --target oci.external.com/acme/agents/production
# Copy the published artifact to another target without re-pushingalquimia registry promote --namespace production --tag v1.2.0 \ --target ghcr.io/acme/agents/productionpromote is the recommended way to move a release between registries: it preserves the exact manifest digest, copies cosign signature material, and avoids the local-workspace hydration bug fixed in 0.7.0.
Secret references
Section titled “Secret references”Agent specs, model registrations, tool registrations, audio configurations, and shield registrations can reference secrets with $secretRef markers. Those markers may point to secrets reached only through model_ref, shield_ref, audio_ref, or tool_ref. As of 0.7.0, registry validation and publish include a recursive walk of all artifact registrations, so secrets referenced only by a referenced registration are no longer flagged as unused or pruned.
Pulling by digest
Section titled “Pulling by digest”To avoid tag-to-manifest TOCTOU issues, pull() resolves the manifest for a tag once, records its digest, and then verifies and fetches by repo@sha256:<digest>. All subsequent operations for that pull use the pinned digest, so a concurrent republish cannot substitute a different manifest mid-pull.
Manifest deletion and version cleanup
Section titled “Manifest deletion and version cleanup”alquimia registry unpublish (and the runtime delete_manifest API) removes the manifest and also deletes the associated cosign .sig and .att tags, so republishes do not leave orphan signature material behind.
alquimia registry flush-version removes a cached versioned snapshot and purges the tag-scoped blob IDs recorded during the pull. This cleans up version blobs even when no <tag>.json cache exists on disk.
Layer path sanitization
Section titled “Layer path sanitization”pull() writes each layer to a path derived from the org.opencontainers.image.title annotation. That annotation is sanitized before use: path separators, parent-directory references (../), and absolute paths are stripped or rejected so a malicious manifest cannot write blobs outside the output directory.
Manifest validation
Section titled “Manifest validation”Every pull() validates the OCI manifest before downloading blobs:
schemaVersionmust be2.annotations["ai.alquimia.registry.dist.schema"](if present) must equalhttps://alquimia.ai/schema/dist+v1.annotations["ai.alquimia.registry.dist.version"](if present) must equalv1.- Every layer must carry a recognized Alquimia Platform media type.
Mismatched schema versions or unrecognized layer types raise an error immediately.
Namespace index
Section titled “Namespace index”The namespace index lets a deployment publish a discoverable catalog of its artifacts without relying on registry-specific APIs such as /v2/_catalog. It is enabled with:
| Variable | Default | Description |
|---|---|---|
ALQUIMIA_OCI_INDEX_ENABLED | false | Enable OCI 1.1 referrers-based namespace index lifecycle |
ALQUIMIA_OCI_REFERRERS_FALLBACK | error | Behavior when the registry lacks native referrers support: error or warn |
ALQUIMIA_OCI_SUBPROCESS_TIMEOUT | 120 | Ceiling (seconds) on any single oras/cosign invocation |
When enabled, publish attaches an entry to a per-namespace anchor (<ns>/index:v1) using the OCI 1.1 referrers API, and delete detaches it. Discovery reads the index rather than the registry catalog, so explore repos and the runtime’s /explore/repos work with the same credentials that already access the namespace.
The anchor is byte-stable: it is built from canonical JSON with a fixed zero timestamp so its digest never changes, which prevents every republish from orphaning the catalog. The digest is computable offline and pinned by tests.
Index discovery works as follows:
explore reposreads the byte-stable anchor implementation.explore tagspaginates over manifests instead of fetching every manifest in a repository at once.explore catalogfilters by--kindbefore applying the cursor, and falls back to the registry catalog only when a namespace has no index anchor.- Detaching an index entry removes orphan cosign
.sigand.atttags from the anchor repository, so republishing does not accumulate stale signature material.
Index entries are recognized by their artifactType or by the ai.alquimia.registry.index.schema annotation every entry carries. This compensates for pre-GA OCI 1.1 registries that report the referrer’s config media type instead of its artifactType. If explore repos or catalog returns an empty list despite a known publish, re-run alquimia registry index reindex after upgrading to 0.6.0 so entries are re-attached with the schema annotation.
The index requires a registry that exposes the native referrers route (for example, zot or Harbor). Without it, ORAS falls back to a mutable sha256-<digest> tag that can silently lose concurrent writes. The code probes for referrers support before writing, pins ORAS to the referrers API, and warns if a fallback tag appears. Set ALQUIMIA_OCI_REFERRERS_FALLBACK=warn only if you accept that risk.
Index CLI
Section titled “Index CLI”# Browse what the deployment publishesalquimia registry explore catalog [--kind agentspace|boltzmann-brain] [--last <repo:tag>]alquimia registry explore entry <repo>:<tag>
# Index maintenancealquimia registry index ensure # create the anchor (idempotent)alquimia registry index status # referrers support + unhealed publish errorsalquimia registry index reindex # re-attach entries for locally known publishesalquimia registry index prune # detach entries whose artifact is gonealquimia registry index migrate -n <agentspace> [--from <ref>] [--to <ref>]index migrate copies an artifact with oras cp (preserving its digest) and cosign copy, and never deletes the source. Use it to move an artifact into the deployment-owned namespace path without re-pushing it.
Trust model
Section titled “Trust model”Index entries are unverified claims: anyone who can push to the namespace can attach one. Annotations are display metadata only; the target manifest must still be fetched and verified before use. Under the default ALQUIMIA_OCI_SIGNATURE_POLICY=required, an entry that fails signature verification is hidden from the listing rather than aborting it, with a warning naming how many were hidden. Enabling the index with required but without cosign configured therefore reads as an empty catalog.
Partial failure
Section titled “Partial failure”If the artifact uploads but the index attach fails, the publish still succeeds (the bytes are live). The error is recorded as index_error on the agentspace, reported by registry index status, and healed by registry index reindex.
Signature verification
Section titled “Signature verification”OCI artifacts can be signed and verified with cosign.
| Variable | Default | Description |
|---|---|---|
ALQUIMIA_OCI_SIGNATURE_POLICY | required | required, warn, or off |
ALQUIMIA_OCI_COSIGN_PUBKEY | — | Cosign public key used to verify on pull; falls back to ALQUIMIA_OCI_COSIGN_KEY |
ALQUIMIA_OCI_COSIGN_KEY | — | Cosign signing (private) key used on push. Works as the verification fallback only for KMS/env:// references |
ALQUIMIA_OCI_COSIGN_CERT_IDENTITY | — | Keyless verification certificate identity |
ALQUIMIA_OCI_COSIGN_CERT_OIDC_ISSUER | — | Keyless verification OIDC issuer |
ALQUIMIA_OCI_COSIGN_SIGN_PUSH | auto | auto signs only when a key or keyless identity is configured; true / false force it on or off |
ALQUIMIA_OCI_COSIGN_TLOG_UPLOAD | true | Upload key-based signatures to the public Rekor log; set to false to opt out |
ALQUIMIA_OCI_COSIGN_HOME | temp dir | Writable HOME for cosign (read-only root filesystems) |
requiredaborts if cosign is missing or the signature is invalid. With no verification key or keyless identity configured, every pull fails.warnlogs a warning and continues on verification failure.offskips verification entirely.
push() signs the artifact automatically when cosign is available and configured.
ORAS and cosign authenticate to the registry with the Docker config ($DOCKER_CONFIG/config.json, default ~/.docker/config.json), for example as written by oras login or docker login.
Dev-mode transport
Section titled “Dev-mode transport”Insecure ORAS flags are gated behind ALQUIMIA_OCI_DEV_MODE=true to prevent accidental use in production:
| Variable | Default | Effect when dev mode is on |
|---|---|---|
ORAS_PLAIN_HTTP | false | Appends --plain-http |
ORAS_INSECURE | false | Appends --insecure |
If either flag is set while dev mode is off, a warning is emitted and the flag is ignored. Keep ALQUIMIA_OCI_DEV_MODE and both flags off in production.
When the OCI index is enabled and the registry lacks native referrers support, ALQUIMIA_OCI_REFERRERS_FALLBACK decides what happens: only the exact value warn enables ORAS’s lossy fallback (index writes can be silently lost under concurrent attaches); any other value behaves as the default error.
Runtime mode and registry access
Section titled “Runtime mode and registry access”| Mode | Registry access | Purpose |
|---|---|---|
master | Read/write | Serves the API and mutates the registry |
worker | Read-only | Consumes Kafka events and runs inference |
all | Read/write | Single-process local development |
Run workers as separate pods with the registry mounted read-only so a compromised inference workload cannot alter agent specs, tool registrations, or topic metadata.
Common operational commands
Section titled “Common operational commands”# Create an agentspacealquimia registry create --name myspace
# Publish an agentspace to OCI (uses ALQUIMIA_OCI_NAMESPACE_AGENTSPACES)alquimia registry publish --namespace myspace --tag v1.2.0
# Pull an agentspace from OCIalquimia registry pull --namespace myspace --tag v1.2.0
# Explore available artifactsalquimia explore repos --registry ghcr.io/acmealquimia explore tags --repository ghcr.io/acme/agents/myspace
# With the index enabled, browse the deployment catalogalquimia registry explore catalog --registry ghcr.io/acmealquimia registry explore entry ghcr.io/acme/agents/myspace:v1.2.0See Publish and pull an agentspace for a step-by-step guide.