Agentic OS AgentSight container image
This topic describes the startup behavior of the AgentSight image and its prerequisites for the kernel, permissions, and process visibility. It also describes the sensitivity of the collected data and the access control of the dashboard, and provides troubleshooting paths for external access failures and common startup failures.
AgentSight is the eBPF-based observability component for AI agents in Agentic OS. It captures the plaintext SSL/TLS traffic, process events, and file operations of agent processes in a non-intrusive manner, and provides an HTTP API and a dashboard. The observed agents do not need code changes or SDK injection.
This image is an out-of-the-box single-component image. After the image is started, it runs as a resident service, and the dashboard and the HTTP API listen on port 7396. If you want to combine multiple Agentic OS components in one image, use the Agentic Edition base image as the FROM image and build the image on your own.
Read the "Data sensitivity and access control" section before you use this image. The content collected by AgentSight contains plaintext SSL/TLS data, which is highly sensitive. Configure the port exposure scope with caution.
Image versions
|
Image name |
Address |
Information |
|
AgentSight |
ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentsight0.11.2-alinux4 |
agentsight: 0.11.2 |
Image information
|
Item |
Value |
|
Image address |
|
|
AgentSight version |
0.11.2 |
|
Base image |
|
|
Architecture |
|
|
Runtime user |
|
|
Listening port |
|
|
ENTRYPOINT |
|
|
Main process |
Runs |
Startup behavior
When the entrypoint starts, it performs the following three operations in sequence:
-
Verifies eBPF permissions. The output of
capsh --printmust containcap_bpforcap_sys_admin. If neither is present, the container exits immediately and prints a fix suggestion. This fast-failure behavior is intentional. If the permissions are insufficient, AgentSight cannot collect any data, and letting the container start makes troubleshooting more difficult. -
Mounts tracefs and debugfs on its own. The entrypoint mounts
/sys/kernel/debugand/sys/kernel/tracingin the container. If the operation fails, only a warning (probe attach may fail) is printed, and the container does not exit. -
Runs AgentSight in the foreground. This keeps the container alive so that port
7396can be used for health checks.
If you pass any command to the container, AgentSight is skipped and the command is run directly. This is used to enter the container for troubleshooting:
docker run -ti --rm --privileged <image> bash
Prerequisites
|
Condition |
Description |
|
eBPF permissions |
|
|
tracefs and debugfs |
Dependencies for attaching kprobes and tracepoints. The entrypoint mounts them in the container, which requires |
|
Process visibility |
AgentSight can attach uprobes only if it can see the observed processes. For more information, see the following description |
|
Kernel |
A recent kernel that supports eBPF and BTF is required. Alibaba Cloud Linux 3 and Alibaba Cloud Linux 4 meet the requirement by default |
Process visibility must be explicitly configured. By default, a container can see only the processes in its own PID namespace. In this case, AgentSight starts as expected but cannot observe any agent. The symptom is that the service is healthy but no data is collected. To observe agents on the host or in other containers, you must share the PID namespace:
--pid=host # Observe all processes on the host
--pid=container:<target container> # Observe only the processes in a specific container
Data sensitivity and access control
AgentSight collects plaintext SSL/TLS data, process command lines, and file operations, which are highly sensitive. The access token of the dashboard is contained in the URL in plaintext and is recorded in browser history and proxy logs. Do not expose port 7396 to the Internet as 0.0.0.0/0.
We recommend that you bind the port only to the loopback address of the host and access the dashboard over an SSH tunnel. In this way, the host does not expose any port externally:
# When you start the container on the host, bind the port only to the loopback address
docker run -d --name agentsight \
--privileged --pid=host \
-p 127.0.0.1:7396:7396 \
ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentsight0.11.2-alinux4
# Establish a tunnel on your local machine
ssh -N -L 7396:127.0.0.1:7396 <user>@<host IP>
# Then open the following URL in the local browser
# http://127.0.0.1:7396/?token=<current token>
If you must expose the port directly, for example in a trusted internal network, narrow the request sources to specific IP addresses instead of allowing all sources. On Alibaba Cloud ECS, you must allow inbound TCP traffic on port 7396 in the security group and specify your own egress IP address as the authorization object. The same applies to the firewall in the VM:
sudo firewall-cmd --add-port=7396/tcp --permanent && sudo firewall-cmd --reload
Quick start
Observe agent processes on the host
docker run -d --name agentsight \
--privileged --pid=host \
-p 127.0.0.1:7396:7396 \
ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentsight0.11.2-alinux4
Observe agents in a specified container
docker run -d --name agentsight \
--privileged --pid=container:my-agent \
-p 127.0.0.1:7396:7396 \
ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentsight0.11.2-alinux4
Use capabilities instead of privileged mode
--privileged grants all permissions. If the host environment allows, you can grant only the required capabilities:
docker run -d --name agentsight \
--cap-add CAP_BPF --cap-add CAP_PERFMON --cap-add CAP_SYS_ADMIN \
--pid=host -p 127.0.0.1:7396:7396 \
ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/agentic-os:1.3-agentsight0.11.2-alinux4
CAP_SYS_ADMIN is used to mount tracefs and debugfs in the container. If you mount the directories directly from the host (-v /sys/kernel/debug:/sys/kernel/debug -v /sys/kernel/tracing:/sys/kernel/tracing), you can try to remove the capability. However, you must verify whether probe attach works as expected.
Access the dashboard
First, verify that the service runs as expected on the host:
curl -v http://127.0.0.1:7396/
# HTTP/1.1 200 OK is expected
The startup log prints the access URL that contains a token. The token is regenerated each time the container starts. You must use the token of the current startup:
docker logs agentsight 2>&1 | grep -iE "token|http"
After you obtain the token, establish a tunnel to access the dashboard as described in the "Data sensitivity and access control" section.
Usage notes for Kubernetes
Run the image as a native sidecar and enable process namespace sharing at the pod level. Declare AgentSight in initContainers and set restartPolicy: Always to make sure that AgentSight is ready before the observed agent containers. You must set shareProcessNamespace: true at the pod level. Otherwise, AgentSight cannot see the processes in the agent containers. In this case, AgentSight starts but collects no events. This setting is easy to overlook, and the symptom is that the service is healthy but no data is collected, which is difficult to attribute.
Permission configuration
securityContext:
runAsUser: 0
runAsNonRoot: false # The pod-level runAsNonRoot setting must be explicitly overwritten
capabilities:
add: ["BPF", "PERFMON", "SYS_ADMIN", "SYS_PTRACE", "SYS_RESOURCE"]
Take note of the following two points.
-
The container must run as root. A non-root UID cannot obtain the effective capabilities that eBPF requires, even in a privileged container. If
runAsNonRoot: trueis set at the pod level, this container must explicitly overwrite the setting. Otherwise, the kubelet refuses to start the container. -
Some managed clusters do not support fine-grained authorization by using
capabilities.add, and their capability allowlists do not containBPForPERFMON. In this case, you can only useprivileged: trueas a whole and apply for the permission allowlist based on the cluster policies.
Note that capability names in Kubernetes do not contain the CAP_ prefix, which is different from the docker run --cap-add syntax described above.
You do not need to configure hostPath for tracefs and debugfs. The entrypoint mounts them in the container. This is especially important for pods that run on an independent sandbox kernel, such as serverless container instances. In such environments, the hostPath of the host is not equivalent to the tracefs of the sandbox kernel, and mounting in the container is the correct approach.
Probes and ports
ports:
- containerPort: 7396
readinessProbe:
tcpSocket:
port: 7396
initialDelaySeconds: 2
periodSeconds: 3
Port 7396 is used to avoid ports that are commonly occupied by managed clusters, such as 111, 10250, and 10255.
Two settings required for integration with AgentSecCore
The Security Observability panel of the dashboard must connect to AgentSecCore over a Unix socket. If the settings are missing, daemon_unreachable is displayed and the security data view is not loaded.
The following requirements must be met at the same time:
-
Mount the same runtime volume as the daemon to
/run/agent-sec. -
Inject
AGENT_SEC_DAEMON_SOCKET=/run/agent-sec/runtime/daemon.sock. The path must be exactly the same as that of the daemon container. The permissions on the socket are0600and its owner is UID10001. AgentSight runs as root and can bypass the restriction.
Data persistence
env:
- name: HOME
value: /root # Make the stats path resolve to a writable directory
volumeMounts:
- name: data
mountPath: /var/log/sysak # The database of agentsight. We recommend that you store it on a PVC subPath
subPath: agentsight
If /var/log/sysak is not persisted, historical observability data is lost when the pod is recreated. The preceding HOME=/root setting affects only the $HOME/.tokenless/stats.db file written by Tokenless and is irrelevant to the database of AgentSight. If you do not need to integrate with the Tokenless feature, you can leave the setting unspecified.
Resources and debugging
eBPF maps consume memory. We recommend that you set both requests and limits to at least 1 vCPU and 2 GiB. If the two values are equal, the pod obtains the Guaranteed QoS class. To enter the container for troubleshooting, pass args: ["sleep", "infinity"] to the container to skip AgentSight. In this case, you must also comment out readinessProbe. Otherwise, probe failures cause the container to restart repeatedly.
Troubleshoot external access failures
Locate the cause by running the following two commands, from the inside out:
# (1) Check whether the service is accessible on the host
curl -v http://127.0.0.1:7396/
# (2) Check the address on which agentsight listens in the container
docker exec -it agentsight ss -tlnp | grep 7396
|
(1) curl on the host |
(2) Listening address in the container |
Conclusion |
Solution |
|
200 OK |
|
Both the program and the port mapping work as expected |
Check the security group and the firewall. This is the most common root cause |
|
Inaccessible |
|
The service is bound to the loopback address of the container, and the port mapping cannot reach it |
Make AgentSight listen on |
|
Inaccessible |
No output |
The main process is not started |
Check |
Common startup failures
|
Log |
Cause |
Solution |
|
|
The eBPF permissions are not granted, and the entrypoint exits proactively |
Add |
|
|
The binary is missing in the image, which indicates an abnormal image |
Pull the image again and make sure that the tag is correct |
|
|
|
Add |
|
The container starts as expected but no agent event is observed |
The PID namespace is not shared |
Add |
|
The security panel of the dashboard displays |
The integration with AgentSecCore is not configured |
See the socket and environment variable requirements in "Usage notes for Kubernetes" |
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-agentsight0.11.2-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.