Skip to main content

cortex.yaml Reference

The cortex.yaml file defines every agent in your swarm — what it runs, what it's allowed to do, and how many resources it can use.

Full Example

version: "1"
project: my-agent-swarm

# Project-level defaults applied to all agents unless overridden
defaults:
runtime: python3.11
resources:
cpu_limit: 0.5
mem_limit: 512Mi
restart_policy: on-failure
max_restarts: 3

global_capabilities:
- observability.metrics: true
- security.logging: strict

agents:
- name: researcher
description: Fetches and summarises external documents.
entrypoint: agents.researcher:main
resources:
cpu_limit: 1.0
mem_limit: 2Gi
capabilities:
- network.access: ["api.openai.com", "api.dopove.com", "arxiv.org"]
- filesystem.read: ["./data"]
env:
LOG_LEVEL: INFO
ICE_URL: "http://ice-kernel:8000"

- name: writer
description: Takes researcher output and produces final reports.
entrypoint: agents.writer:main
capabilities:
- network.access: ["api.openai.com"]
- filesystem.read: ["./data"]
- filesystem.write: ["./output"]
env:
LOG_LEVEL: INFO

Schema Reference

Root Fields

FieldTypeRequiredDescription
versionstringYesManifest schema version. Currently "1".
projectstringYesUnique name for this swarm. Used in logs and CLI output.
defaultsobjectNoDefault values applied to all agents unless overridden.
global_capabilitieslistNoCapabilities inherited by all agents.
agentslistYesList of agent definitions.

Agent Fields

FieldTypeRequiredDescription
namestringYesUnique agent identifier within the project.
descriptionstringNoHuman-readable description. Shown in cortex list.
runtimestringYesExecution environment: python3.10, python3.11, python3.12, nodejs18, nodejs20.
entrypointstringYesModule path to the agent entry function (e.g., agent:run or agents.worker:main).
resourcesobjectNoCPU and RAM limits. Inherits from defaults if omitted.
capabilitieslistNoExplicit permission grants. Nothing is allowed unless declared.
envmapNoEnvironment variables injected into the agent process.
restart_policystringNoalways, on-failure, or never. Default: never.
max_restartsintegerNoMaximum restart attempts before the agent is marked failed.

Resources

resources:
cpu_limit: 1.0 # Cores. Fractional values supported (e.g., 0.5)
mem_limit: 2Gi # RAM. Accepts Mi or Gi suffix.

Limits are enforced via Linux cgroups. If an agent exceeds its memory limit it is terminated immediately.


Capabilities

CapabilityExample valueEffect
network.access["api.openai.com"]Allow outbound HTTPS to listed domains only
filesystem.read["./data"]Allow read access to listed paths
filesystem.write["./output"]Allow write access to listed paths
observability.metricstrueEmit agent metrics to Cortex metrics endpoint
security.loggingstrictForce structured JSON log output

Capability checks are enforced at the kernel level. An agent cannot bypass them by spawning subprocesses or using syscalls directly.