Skip to content

Workload hardening

The workload layer of the Zero Trust architecture ensures that only trusted, hardened code runs in your cluster. Alquimia Platform provides deployment overlays and policy guidance to enforce this.

ControlPurpose
Immutable image identityEvery runtime image is signed so its origin can be verified.
Signature verification at admissionThe cluster rejects unsigned or untrusted images before they run.
Curated registriesOnly approved container registries are allowed.
Hardened pod specPods run as non-root, drop all capabilities, use a read-only root filesystem, and apply a default seccomp profile.
Resource limitsEvery container declares CPU and memory requests and limits.
MCP stdio allow-listWorker pods refuse to spawn stdio MCP servers unless explicitly allowed.
Egress allow-listOptional per-agentspace host allow-list restricts tool, model, and audio connector destinations.

The runtime repository provides overlays for different environments:

OverlayUse
kubernetesVanilla Kubernetes without admission policies for flexibility.
productionIncludes Kyverno admission policies (Enforce mode) that enforce signing, registry allow-lists, and pod security.
openshiftOpenShift / ROSA; uses OpenShift’s built-in security constraints instead of Kyverno policies.
spire-openshiftSPIRE deployment patched for OpenShift, for SPIFFE workload identity.

Choose the overlay that matches your cluster’s security tooling and compliance requirements.

On OpenShift, the restricted-v2 SCC enforces the hardened pod spec. Red Hat Advanced Cluster Security or ClusterImagePolicy takes over the signature, registry, and resource policies that Kyverno enforces on vanilla Kubernetes. See the supported operator stack.

Agent specs are code-level configuration, and pulled registry artifacts are loaded straight into agent specs. alquimia-core 0.6.1 adds execution-side guards for the risky parts of a spec.

MCP stdio transport (command, args, env, and transport: "stdio") spawns a subprocess inside the worker pod. In 0.6.1 this is rejected by default. Enable it only by setting ALQUIMIA_MCP_STDIO_ALLOWED=true and, preferably, narrowing the allowed commands with ALQUIMIA_MCP_STDIO_ALLOWLIST. The recommended pattern in production is to run stdio servers as separate sidecars or external services and connect to them over HTTP.

Agentspace metadata can carry an egress_allowlist of allowed hosts. When set, the runtime checks every tool URL, model base_url, and audio connector base_url/host against the list and refuses calls to destinations that are not explicitly allowed. This prevents a compromised or malicious spec from exfiltrating secrets to an arbitrary host. See the Runtime configuration reference for the environment variables and the CLI reference for how to set the allow-list on an agentspace.

Runtime images are signed during the build pipeline using keyless signing tied to the CI workflow. At admission, the cluster verifies that the image was built by the trusted workflow and mutates the image reference to its digest for immutability.

If a workload genuinely needs to deviate from a policy — for example, a disaster-recovery container that must run as root — add an explicit exception rather than relaxing the base policy. Document the business justification and review period.

Worker pods run arbitrary agent code, tool calls, and model inference. The runtime hardens the boundary between the control plane and workers so that a compromised worker cannot spoof tasks, replay old events, or read secrets outside its scope.

Every Kafka CloudEvent is signed with a kid from a key ring. Set KAFKA_SIGNING_KEY (a 64-character hex key) for a single-key deployment, or KAFKA_SIGNING_KEYS (kid1:hex1,kid2:hex2) to support rotation. Keys must be 32 bytes of decoded key material. Workers verify signatures before handling events; pre-#339 signatures are rejected unless KAFKA_SIGNING_ACCEPT_LEGACY=true.

VariablePurpose
KAFKA_SIGNING_KEYSingle signing/verification key
KAFKA_SIGNING_KEYSKey ring for rotation and verification
KAFKA_SIGNING_ACCEPT_LEGACYAccept pre-#339 signatures during rolling upgrades

Signed events whose time is outside KAFKA_EVENT_MAX_AGE_SECONDS (default 1 hour, with ±5 minutes skew tolerance) are sent to the DLQ. The runtime also de-duplicates by (source,id) with Redis SET NX and makes tool calls idempotent by (task_id, control_id, step_id). Failed or timed-out dispatches release their claim so DLQ redrive can retry them.

VariablePurpose
KAFKA_EVENT_MAX_AGE_SECONDSMaximum accepted age of a signed event
KAFKA_HANDLER_TIMEOUT_SECONDSCeiling on handler runtime before DLQ

MCP tool results and A2A sub-agent results are screened by the shields map on ToolRegistration before they reach the agent context. If a shield errors, the tool call fails closed. This prevents retrieved or computed data from carrying prompt-injection payloads into the model.

The runtime clamps agent-specified execution limits so a malicious or oversized spec cannot exhaust the worker:

VariableDefaultCeiling
EVALUATION_MAX_STEPS_CEILING50Max max_steps
EVALUATION_MAX_CONCURRENT_TOOLS_CEILING16Max concurrent tool calls
MCP_TOOL_TIMEOUT_SECONDS120MCP fetch + call time
KAFKA_HANDLER_TIMEOUT_SECONDS540Total Kafka handler time

Set TLS_ENFORCE=true to enable a production profile that refuses unsafe configurations:

  • POSTGRES_SSL_MODE must be verify-full; anything weaker counts as plaintext.
  • Keycloak and OTLP endpoints must use HTTPS.
  • ENCRYPTION_KEY and KAFKA_SIGNING_KEY must both be configured.
  • KNOWLEDGE_AUTHZ_DEFAULT_DENY defaults to true.

Provider webhooks are verified with provider-specific signatures or tokens. In addition:

  • TRUSTED_PROXY_CIDRS restricts which proxies may supply X-Forwarded-For.
  • Browser WebSocket streams must use single-use encrypted tickets from POST /streaming/auth-ticket (?ticket=); ?token= is refused unless STREAMING_ALLOW_QUERY_TOKEN=true.
  • Clean sessions close with 1000; close reasons are capped to RFC 6455 limits.

v2 envelopes bind AES-GCM AAD to the Redis key or Postgres table.column, and plaintext is refused once a key is configured unless ENCRYPTION_ALLOW_PLAINTEXT_READS=true. v1 envelopes remain readable via ENCRYPTION_ALLOW_UNBOUND_READS (default on). Channel routes, route tokens, pending approvals, Twilio stream tickets, and WebSocket tickets are sealed, and ticket Redis keys are SHA-256 hashes.

  • Pin images to digests in production overlays.
  • Scan images for vulnerabilities before deployment.
  • Limit registry access to trusted sources.
  • Rotate signing credentials on a schedule.
  • Monitor admission-control denials as a security signal.