Agentic OS AgentSecCore container image

Updated at:

This topic describes the prerequisites for running the AgentSecCore image, which are the permission and owner requirements of two runtime directories. It also provides an environment variable reference and troubleshooting information.

The AgentSecCore daemon is the resident security control plane service of Agentic OS. It uses a Unix domain socket to provide capabilities such as health checks, queries for security events and observability data, SkillFS change notifications, and Skill Ledger background tasks.

Prompt injection scans, code scans, and PII checks are currently performed by agent-sec-cli in the agent container, which is called by an agent plug-in or hook. The results are written to the shared persistent data directory. The daemon does not perform these scans and is not responsible for loading or running scan models. When a semantic model is required, agent-sec-cli accesses an independently deployed Ollama model service. For more information, see Agentic OS Ollama container image .

Running the daemon as an independent resident process provides the following main benefits:

  • It provides a stable UDS entry point for control and queries to the components in the same trusted deployment unit.

  • It reads security events and observability data in a unified manner and provides structured queries for components such as AgentSight.

  • It continuously runs background tasks such as Skill Ledger activation and SkillFS change coordination.

  • It decouples the long-lifecycle control plane state, connection management, and background tasks from the main agent process.

  • Health checks, graceful shutdown, and failure restarts are managed by container orchestration in a unified manner.

During deployment, the daemon and the agent container must share the runtime volume to access the UDS. If you want the daemon to query the security events generated on the agent side, both containers must also mount the same persistent data volume and use the same AGENT_SEC_DATA_DIR value. This image does not require root permissions, privileged mode, or any additional capabilities. However, you must prepare two runtime directories. The permissions on /run/agent-sec/runtime are strictly verified during startup. This is the most common cause of startup failures for this component. Read the "Prerequisites" section first.

Image versions

Image name

Address

Information

AgentSecCore container

ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentseccore0.11.1-alinux4

AgentSecCore: 0.11.1

Image information

Item

Value

Image address

ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentseccore0.11.1-alinux4

AgentSecCore version

0.11.1

Base image

alinux4:4.0.5

Architecture

linux/amd64

Runtime user

10001:10001 (non-root)

External interface

A Unix domain socket. No TCP port is listened on

ENTRYPOINT and CMD

/usr/local/bin/agent-sec-daemon plus serve

Health check

/usr/local/bin/agent-sec-daemon-health. Exit code 0 indicates a healthy state

Privilege requirements

None. Root permissions, privileged mode, and additional capabilities are not required

The daemon stops normally after it receives SIGTERM. You can let container orchestration manage its lifecycle.

Prerequisites

The image does not contain the runtime directories. You must prepare and mount them. Otherwise, the daemon cannot start.

Path in the container

Purpose

Permission requirement

/run/agent-sec/runtime

Stores daemon.sock, which is used by agents to call the control and query interfaces of the daemon

Must be strictly 0700, and the owner must be 10001:10001

/var/lib/agent-sec/persistent

The persistence directory for detection events, configurations, and data

The owner must be 10001:10001, and 0775 is sufficient

0700 is a strict requirement, not a recommendation. When the daemon starts, it checks the permissions on the runtime directory. Any additional group or other permission causes a startup failure. This is also why you cannot use the pod-level fsGroup setting in Kubernetes. The kubelet appends group permissions to the directory, which causes the verification to fail. For more information, see "Usage notes for Kubernetes".

The persistence directory stores security detection records. We recommend that you manage the access permissions and the retention period of the volume based on the storage requirements for internal sensitive data.

Quick start

Prepare the directories and start the container

# 1. Prepare the directories. Note that runtime must be 0700 and owned by 10001
sudo mkdir -p /srv/agent-sec/runtime /srv/agent-sec/persistent/events
sudo chown -R 10001:10001 /srv/agent-sec
sudo chmod 0700 /srv/agent-sec/runtime

# 2. Start the daemon
docker run -d --name agent-sec-daemon \
  -v /srv/agent-sec/runtime:/run/agent-sec/runtime \
  -v /srv/agent-sec/persistent:/var/lib/agent-sec/persistent \
  ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentseccore0.11.1-alinux4

Verify the health status

docker exec agent-sec-daemon /usr/local/bin/agent-sec-daemon-health && echo OK

The script sends a daemon.health request over the socket that AGENT_SEC_DAEMON_SOCKET points to, and verifies that status == "ok" is returned. If the check fails, the specific cause is printed, such as a missing socket, a timeout, or an abnormal response.

Connect an agent to the daemon

Three steps are required on the agent side: install the CLI, share the volumes, and align the runtime UID.

1. Install agent-sec-cli in the agent image

The daemon does not perform prompt injection scans, code scans, or PII checks. These operations are performed by agent-sec-cli in the agent container. Therefore, agent-sec-cli must be installed in the agent image. We recommend that you install it during the image build phase:

RUN curl -fsSL https://get.agentic-os.sh | bash \    
    && export PATH="/root/.local/bin:${PATH}" \    
    && anolisa install sec-core  \    
    && anolisa adapter enable sec-core <agent name>

Do not install it at runtime. The bootstrap script requires root permissions and access to the Internet, whereas an agent usually runs as the non-root UID 10001 at runtime, as described in step 3. In addition, the installation package cannot be downloaded in an offline environment.

For the list of agents that AgentSecCore supports, see How to use AgentSecCore

  1. Share the volumes and configure the environment variables

  • Mount the same runtime volume and specify the same AGENT_SEC_DAEMON_SOCKET value to call the control and query interfaces of the daemon.

  • Mount the same persistent data volume and set AGENT_SEC_DATA_DIR to the same path. Otherwise, the daemon cannot query the events written on the agent side.

  1. Runtime UID

The runtime UID of the agent container must be able to access the socket. The runtime directory is 0700 and is owned by 10001. Therefore, the agent usually also runs as 10001.

Enable a local model for semantic detection (optional)

The L2 semantic check of prompt scans is provided by an independent Ollama service. Access to ModelScope is required to download the model for the first time. After the model is cached, the service can run offline. First, start a container named agent-sec-ollama and load the model as described in Agentic OS Ollama container image. The environment variables of the model service must be configured in the agent container that runs agent-sec-cli. The following example shares the network namespace of Ollama, so 127.0.0.1:11434 is used.

docker run -ti --rm \
  --network container:agent-sec-ollama \
  -v /srv/agent-sec/runtime:/run/agent-sec/runtime \
  -v /srv/agent-sec/persistent:/var/lib/agent-sec/persistent \
  -e AGENT_SEC_DAEMON_SOCKET=/run/agent-sec/runtime/daemon.sock \
  -e AGENT_SEC_DATA_DIR=/var/lib/agent-sec/persistent/events \
  -e AGENT_SEC_MODEL_SERVICE_BACKEND=ollama \
  -e AGENT_SEC_MODEL_SERVICE_BASE_URL=http://127.0.0.1:11434 \
  -e AGENT_SEC_MODEL_SERVICE_TIMEOUT=30 \
  -e PROMPT_SCANNER_L2_MODEL=modelscope.cn/ANOLISA/Warden-Gen-0.6B-GGUF \
  <your agent image>

If the machine performance is limited, for example fewer than 4 vCPUs and 8 GB of memory, we recommend that you use rule matching for prompt scans. Set PROMPT_SCANNER_SCAN_MODE to fast.

docker run -ti --rm \
  -v /srv/agent-sec/runtime:/run/agent-sec/runtime \
  -v /srv/agent-sec/persistent:/var/lib/agent-sec/persistent \
  -e AGENT_SEC_DAEMON_SOCKET=/run/agent-sec/runtime/daemon.sock \
  -e AGENT_SEC_DATA_DIR=/var/lib/agent-sec/persistent/events \
  -e PROMPT_SCANNER_SCAN_MODE=fast \
  <your agent image>

Environment variable reference

Default values built into the image

Variable

Default value

Description

AGENT_SEC_DAEMON_SOCKET

/run/agent-sec/runtime/daemon.sock

The socket path over which services are provided

AGENT_SEC_DATA_DIR

/var/lib/agent-sec/persistent/events

The directory to which detection events are written

XDG_CONFIG_HOME

/var/lib/agent-sec/persistent/config

The configuration directory

XDG_DATA_HOME

/var/lib/agent-sec/persistent/data

The data directory

HOME

/home/agent-sec

The home directory of the runtime user

Detection policies and collaboration (configure as needed)

Variable

Example value

Description

AGENT_SEC_HEALTH_TIMEOUT_SECONDS

1

The timeout period of the health check script. Unit: seconds

AGENT_SEC_SKILLFS_CONTROL_SOCKET

/run/agent-sec/skillfs/control.sock

The control socket for collaboration with SkillFS

AGENT_SEC_SKILLFS_NOTIFY_AUTH_KEY_FILE

/run/agent-sec/keys/notify.key

The HMAC key file of the notification channel

AGENT_SEC_SKILLFS_CONTROL_AUTH_KEY_FILE

/run/agent-sec/keys/control.key

The HMAC key file of the control channel

The integration with SkillFS is used for Skill Ledger protection. SkillFS notifies the daemon of changes in the skill directory. After the daemon records the changes in the ledger, scans the signatures, and makes activation decisions, it uses the control socket of SkillFS to determine which skills are visible to the agent. This integration is optional and takes effect only if both sides are configured. For the parameters on the SkillFS side, see Agentic OS SkillFS container image.

For collaboration with SkillFS, you must generate the two key files (each contains 32 bytes of random content, with permissions 0600 and owner 10001) and let both containers mount the same copy:

sudo install -d -o 10001 -g 10001 -m 0700 /srv/agent-sec/keys
head -c 32 /dev/urandom | sudo tee /srv/agent-sec/keys/notify.key >/dev/null
head -c 32 /dev/urandom | sudo tee /srv/agent-sec/keys/control.key >/dev/null
sudo chown 10001:10001 /srv/agent-sec/keys/*.key && sudo chmod 0600 /srv/agent-sec/keys/*.key

Usage notes for Kubernetes

Do not specify fsGroup. Use an init container to prepare the directories

The daemon strictly requires that /run/agent-sec/runtime is exactly 0700. The pod-level fsGroup setting causes the kubelet to append group permissions to the directory, which causes the verification to fail and the daemon to exit immediately after startup. The correct approach is to use a regular init container to prepare the directories:

initContainers:
- name: prepare
  image: <a base image that contains bash, install, and stat>
  command: ["/bin/bash", "-lc"]
  args:
  - |
    set -euo pipefail
    install -d -o 10001 -g 10001 -m 0700 /run/agent-sec/runtime
    install -d -o 10001 -g 10001 -m 0775 /var/lib/agent-sec/persistent/events
    # Tighten the permissions again at the end to avoid the impact of intermediate steps or umask
    chmod 0700 /run/agent-sec/runtime
    stat -c 'runtime mode=%a owner=%u:%g' /run/agent-sec/runtime
  securityContext:
    runAsUser: 0
    runAsNonRoot: false
    allowPrivilegeEscalation: false
    capabilities:
      drop: ["ALL"]
      add: ["CHOWN", "FOWNER", "DAC_OVERRIDE"]
  volumeMounts:
  - name: runtime
    mountPath: /run/agent-sec
  - name: data
    mountPath: /var/lib/agent-sec/persistent

A PVC mount shadows the directory with the same name in the image layer

After you mount a PVC to /var/lib/agent-sec/persistent, everything created under the path during the image build phase is invisible. Therefore, the subdirectories and their owners must be created at runtime by an init container. Do not rely on mkdir and chown in the Dockerfile phase.

Container role

We recommend that you run the container as a native sidecar. That is, declare it in initContainers, set restartPolicy: Always, and configure a startupProbe for the daemon. The kubelet starts the agent only after the probe succeeds. This feature is available by default in Kubernetes 1.29 and later. In Kubernetes 1.28, you must explicitly enable the feature gate. Versions earlier than 1.28 do not support the feature. If your cluster does not support the feature or provides limited support, which is the case for some serverless container clusters, run the container as a regular app container. The startup sequence of regular app containers is not guaranteed, and the startupProbe only determines the status of the daemon itself. The entrypoint of the agent must also wait until the daemon is healthy before it starts.

Volume configuration

Volume

Type

Description

runtime

emptyDir, which must be pod-local

Stores the Unix socket. Network storage such as a PVC or NFS cannot be used because a UDS requires a local file system. We recommend that you specify sizeLimit: 32Mi

data

PVC

Persists detection events and configurations. Note that an RWO PVC cannot be shared across nodes by multiple replicas

All containers that need to access the control and query interfaces of the daemon, including the agent, SkillFS, and AgentSight, must mount the same runtime volume to /run/agent-sec.

Probes

All three probes directly use the health check script provided by the image:

startupProbe:
  exec:
    command: ["/usr/local/bin/agent-sec-daemon-health"]
  periodSeconds: 5
  timeoutSeconds: 2
  failureThreshold: 60      # Reserve a window for cold starts
readinessProbe:
  exec:
    command: ["/usr/local/bin/agent-sec-daemon-health"]
  periodSeconds: 5
  timeoutSeconds: 2
  failureThreshold: 3
livenessProbe:
  exec:
    command: ["/usr/local/bin/agent-sec-daemon-health"]
  initialDelaySeconds: 10
  periodSeconds: 10
  timeoutSeconds: 2
  failureThreshold: 3

Do not overwrite command arbitrarily

The image provides ENTRYPOINT and CMD. The safest approach is to omit command and args. If you must specify them, the paths must be the same as the actual paths in the image:

command: ["/usr/local/bin/agent-sec-daemon"]
args: ["serve"]

An incorrect path results in exec ...: no such file or directory, and the container immediately enters the CrashLoopBackOff state. Run the following command to confirm the actual path:

kubectl run --rm -it tmp --image=<image> --command -- command -v agent-sec-daemon

Other recommendations

  • Specify terminationGracePeriodSeconds: 30. The daemon handles SIGTERM gracefully, so give it time to exit.

  • We recommend 4 vCPUs and 8 GiB of memory, with equal requests and limits values.

  • Keep the security context minimal by specifying allowPrivilegeEscalation: false and capabilities.drop: ["ALL"]. This container does not require any additional permissions.

  • If the agent and Ollama run in the same pod, the agent container can directly use http://localhost:11434 as the model service address.

Troubleshooting

Symptom

Cause

Solution

The daemon exits immediately after startup, and the log indicates an issue with the permissions on the runtime directory

The runtime directory is not exactly 0700, or its owner is not 10001

Run chown 10001:10001 and chmod 0700. In Kubernetes, remove fsGroup and use an init container to run install -d -o 10001 -g 10001 -m 0700

The health check reports socket is missing or is not a Unix socket

The daemon is not started, or the AGENT_SEC_DAEMON_SOCKET value is inconsistent with the actual path

First check docker logs. Then make sure that the environment variables on both sides point to the same path

The health check reports missing command: curl or jq

The script is run outside this image

The script depends on the curl and jq commands provided by the image. Run it only in this image

The agent side reports permission denied when it connects to the socket

The runtime UID of the agent does not have permissions to access the 0700 runtime directory

Run the agent as 10001 as well

The startup reports exec ...: no such file or directory

The startup path is overwritten by command or --entrypoint, and the path is incorrect

Preferably, do not overwrite the path and use the ENTRYPOINT provided by the image. To confirm the actual path, run docker run --rm --entrypoint /bin/bash <image> -c 'command -v agent-sec-daemon'

Semantic detection does not take effect

The model service is not configured, or AGENT_SEC_MODEL_SERVICE_BASE_URL is unreachable. Requests may also time out because the machine specifications are insufficient

Complete the configuration as described in "Enable a local model for semantic detection". Then run curl "$AGENT_SEC_MODEL_SERVICE_BASE_URL/api/tags" in the agent container to verify the connectivity and the model loading status

Image update policy

This image is released in line with the release cadence of Agentic OS, and the interval between releases does not exceed one month. After a new version is released, the previous version is no longer maintained. Issue fixes and component upgrades are applied only to the latest version. We recommend that you upgrade at the earliest opportunity.

When you deploy the image, use a tag that contains the complete version number, such as 1.3-agentseccore0.11.1-alinux4, to ensure reproducibility, and schedule a window for regular upgrades. You must do both. If you pin the version but never upgrade, you remain on a version that is no longer maintained for a long time.