Publish and pull an agentspace
Agentspaces can be packaged as OCI artifacts, signed with cosign, and promoted through environments the same way you promote container images. This guide walks through publishing an agentspace and pulling it into another runtime.
Before you begin
Section titled “Before you begin”- Install
alquimia-core[registry]. - Have access to an OCI registry (GHCR, Docker Hub, ECR, Harbor, or a private ORAS registry).
- Optionally install cosign if you want signed artifacts.
Publish an agentspace
Section titled “Publish an agentspace”-
Create or load the agentspace locally.
Terminal window alquimia registry create --name productionalquimia registry agents add support-bot.json --namespace productionAs of
alquimia-core0.5.3,registry createno longer has a--namespaceflag;-n/--namespaceconsistently means the agentspace name on every other command. As ofalquimia-core0.5.5, agentspace names must be valid OCI name components; consecutive separators are rejected. -
(Recommended) classify tools and topics before publishing.
Unsigned, unclassified tools are denied under the default Zero Trust policy when the agentspace is pulled into a production runtime.
Terminal window alquimia registry tools add filesystem-tools \--provider-id mcp \--connection-config '{"url": {"$secretRef": "FILESYSTEM_MCP_URL"}}'alquimia registry tools set-operation filesystem-tools "list_*" \--match glob --severity read-only --tier-grants reader,editor,operator -
Publish to the OCI registry.
Terminal window export ALQUIMIA_OCI_REGISTRY_DEFAULT=ghcr.ioexport ALQUIMIA_OCI_NAMESPACE_AGENTSPACES=agentsalquimia registry publish --namespace production --tag v1.0.0As of
alquimia-core0.5.3, the OCI path is derived from the deployment namespace (<registry>/<ALQUIMIA_OCI_NAMESPACE_AGENTSPACES>/<name>), not from agentspace metadata. The example above publishes toghcr.io/acme/agents/production:v1.0.0when the active Docker/OCI login is forghcr.io/acme.Add
--include-secretsto also publish secret metadata (key, scope, dtype, required). Secret values are never included. Add--forceto take over a tag that was last published by someone else. As ofalquimia-core0.5.5, you can also use--target <repo_id>to push to a specific OCI repository,--include-agents <ids>to publish only selected agents, and--exclude-agents <ids>to omit selected agents.alquimia registry unpublishaccepts--targetas well.Publish to an alternate repository with
--target, or publish only a subset of agents with--include-agentsand--exclude-agents:Terminal window alquimia registry publish --namespace production --tag v1.0.0 \--target ghcr.io/acme/agents/productionalquimia registry publish --namespace production --tag v1.0.0 \--include-agents onboarder,closer \--exclude-agents deprecated-botWhen you publish a subset of agents, only those agents and the resources they reach (tools, topics, files, models, brains, parameters, and secrets) are included.
-
Verify the manifest in the registry.
Terminal window alquimia explore tags --repository ghcr.io/acme/agents/productionWith
ALQUIMIA_OCI_INDEX_ENABLED=true, you can also browse the deployment catalog:Terminal window alquimia registry explore catalog --registry ghcr.io/acmealquimia registry explore entry ghcr.io/acme/agents/production:v1.0.0
Sign artifacts with cosign
Section titled “Sign artifacts with cosign”If cosign is installed and ALQUIMIA_OCI_COSIGN_KEY is set, publish signs the artifact automatically. For keyless signing, set the certificate identity and issuer instead:
export ALQUIMIA_OCI_COSIGN_CERT_IDENTITY=alice@acme.comexport ALQUIMIA_OCI_COSIGN_CERT_OIDC_ISSUER=https://accounts.google.comThe signature is verified on every pull according to ALQUIMIA_OCI_SIGNATURE_POLICY:
| Policy | Behaviour |
|---|---|
required (default) | Abort on missing or invalid signature |
warn | Log a warning and continue on failure |
off | Skip verification |
Pull an agentspace
Section titled “Pull an agentspace”On the target runtime:
-
Authenticate to the registry if needed (
oras loginordocker login). ORAS and cosign read credentials from the Docker config ($DOCKER_CONFIG/config.json, default~/.docker/config.json). -
Set the signature verification policy.
Terminal window export ALQUIMIA_OCI_SIGNATURE_POLICY=requiredexport ALQUIMIA_OCI_COSIGN_PUBKEY=/etc/alquimia/cosign.pubVerification uses
ALQUIMIA_OCI_COSIGN_PUBKEY;ALQUIMIA_OCI_COSIGN_KEYis the signing key and only works as a fallback for KMS/env://references. Withrequiredand no key or keyless identity configured, every pull fails. Use the exact lowercase valuerequired: inalquimia-core≤ 0.5.6 other spellings such asRequiredbehave likewarn. -
Pull the artifact.
Terminal window alquimia registry fetch --namespace production \--target ghcr.io/acme/agents/production --tag v1.0.0fetchwithout--tagoverwrites the workspacedist.json; with--tagit caches the versioned snapshot instead. Pulling rehydrates local knowledge bases from the file registrations contained in the artifact.
Run a specific version without overwriting the workspace
Section titled “Run a specific version without overwriting the workspace”Introduced in alquimia-core 0.5.2, registry fetch pulls an OCI tag into a cached versioned snapshot instead of overwriting the workspace dist.json. You can then run agents from that snapshot directly.
-
Fetch a versioned snapshot.
Terminal window alquimia registry fetch --namespace production --tag v1.0.0Add
--no-cacheto force a fresh pull from OCI. -
List cached versions.
Terminal window alquimia registry versions --namespace production -
Run an agent from the snapshot.
Terminal window alquimia local exec production/support-bot:v1.0.0 "What is the refund policy?" -
Remove the cached snapshot when no longer needed.
Terminal window alquimia registry flush-version --namespace production v1.0.0As of
alquimia-core0.5.5,flush-versionalso cleans up the<tag>/...blob copies created for the versioned snapshot.
This is useful for testing a release before promoting it, running older snapshots side-by-side, or reproducing a past inference result without changing the live workspace.
Encrypted local registries
Section titled “Encrypted local registries”If ALQUIMIA_REGISTRY_KEY is set on the source runtime, the local TinyDB files stay encrypted. The OCI artifact itself is published as plaintext JSON so the target runtime does not need your AES key to consume it. The target runtime can encrypt its own local copy with a different key if desired.
Promoting through environments
Section titled “Promoting through environments”A typical promotion flow looks like this:
dev agentspace ──publish──► ghcr.io/acme/agents/production:v1.0.0-dev │ ▼staging agentspace ◄──fetch── validate / test │ ▼production agentspace ◄──fetch── approve and tag v1.0.0Use immutable tags for releases and keep a latest tag only for development. Record the OCI digest in your change-management system so audits can correlate a running agent to the exact artifact it came from.
Migrating artifacts published before 0.5.3
Section titled “Migrating artifacts published before 0.5.3”Artifacts published before alquimia-core 0.5.3 lived at <registry>/<metadata-namespace>/<name>. To move one to the new deployment-owned namespace without changing its digest (and therefore without invalidating signatures or cached versions):
alquimia registry index migrate -n productionThis copies the artifact with oras cp, runs cosign copy for any classic signature tag, updates the local agentspace’s target_repo_id, and never deletes the source. Verify with cosign verify at the destination, then run alquimia registry index reindex to advertise it in the namespace index.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
signature verification failed | Cosign key mismatch or missing signature | Verify the correct public key or set policy to warn only in dev |
manifest schema version mismatch | Artifact was not produced by Alquimia Platform | Check the registry repository and tag |
unrecognized media type | Layer from a newer/older Alquimia Platform version | Upgrade or downgrade alquimia-core to match |
publish refused: tag already exists with a different author | Another agentspace shares the same name | Use a unique name, or pass --force if you are reclaiming the tag |
explore catalog returns empty with required policy | Index entries are unsigned | Configure cosign signing or set ALQUIMIA_OCI_SIGNATURE_POLICY=warn |
index attach failed warning after publish | Registry lacks native OCI 1.1 referrers support | Use a referrers-capable registry (zot/Harbor), or set ALQUIMIA_OCI_REFERRERS_FALLBACK=warn and accept the risk |
oras push failed with stderr and target reference | ORAS could not reach the registry or the push was rejected | Check the target reference, registry credentials, and network reachability; the error includes the full oras stderr |
pull refused: local registry is read-only | Worker pod cannot write | Run pull against the master instance (PUT /registry/pull); do not switch workers to master mode, because only one master may write the registry |