---
title: "Agent security contract"
description: "For each TRUSTIVAN component that runs in or reaches into your environment: what it reads, what it never does, its network traffic, and how to check it."
---

Five TRUSTIVAN components touch your environment. Two are installed by you
(the runtime sensor, and the CLI or GitHub Action); three run on the TRUSTIVAN
deployment and reach in with a credential you create (the Kubernetes collector,
the cloud collectors) or that you hand to an assistant (the MCP server). This
page states, for each, what it reads, what it never does, where its traffic
goes, and how to verify it. Each statement is taken from the code or chart at
this release; where something has not been verified, the linked page says so.

## Runtime sensor (`trustivan-runtime` Helm chart)

Falco on every node, with TRUSTIVAN's rule library, plus a relay that adds your
key. See [Runtime sensor](/configuration/runtime-sensor).

**Reads.** Kernel events through Falco's modern eBPF probe, matched against
the chart's rules. `/proc` and `/etc` of the host and the container runtime's
socket directories, all mounted read-only; Falco's container plugin asks the
runtime for container, pod and image names. A detection carries the rule, the
container and image, the process name and **command line**, the user name and,
for file rules, the file path. A command line holds whatever was typed on it.

**Never.**
- No kernel module and not privileged: root with four capabilities (`BPF`,
  `PERFMON`, `SYS_RESOURCE`, `SYS_PTRACE`), no privilege escalation, read-only
  root filesystem. Not in the host's network or PID namespace.
- No Kubernetes API access: the ServiceAccount mounts no token and has no Role
  or ClusterRole bound.
- No file contents, no Secret, no private key: no rule outputs file contents,
  and nothing in the chart mounts a Secret into Falco. The relay reads only your
  TRUSTIVAN key, from a Secret, into its environment.

**Listens.** Falco's health endpoint on the pod's port `8765` (`/healthz` only;
Prometheus metrics are off) and the relay's on `8081` (`/healthz` only), both on
the pod network for the kubelet's probes. The relay's event listener is on the
pod's loopback, `127.0.0.1:8080`, reachable only from inside the pod.

**Egress.** HTTPS `POST` to `<trustivan.url>/api/v1/kubernetes/clusters/<clusterId>/events`,
TLS verified against the image's CA bundle, at most 1 MiB a request; DNS
through the cluster's resolver; image pulls of Falco and nginx, both pinned by
digest. Nothing else.

**Verify.**
- `helm template` the chart and read `templates/sensor.yaml`; CI runs
  `scripts/ci/check-runtime-chart.sh`, which fails on a missing digest, a fifth
  capability, any RBAC object or a relay listening beyond loopback.
- `kubectl -n <namespace> get daemonset trustivan-runtime -o yaml`: the
  `securityContext`, `automountServiceAccountToken: false` and the volumes.
- Add a NetworkPolicy allowing egress only to your TRUSTIVAN host and DNS; the
  sensor keeps working.

## Runtime responder (`responder.enabled` in the same chart)

Off by default. One Deployment that polls TRUSTIVAN for its cluster's approved
[response actions](/configuration/runtime-sensor#response-actions) and carries
them out.

**Reads.** The actions TRUSTIVAN dispatches to its cluster: namespace, pod,
owning workload, action, rule. Its own ServiceAccount token, to call the API
server.

**Changes.** Only what an approved action names, with a ClusterRole holding
exactly: `delete` and `patch` on pods, `patch` on `deployments/scale` and
`statefulsets/scale`, `create` on networkpolicies. No `get`, `list` or `watch`
on anything, and nothing on Secrets. A dry-run action is sent with
`dryRun=All` and changes nothing.

**Never.** Acts in `kube-system`, `kube-public` or `kube-node-lease`; listens
on any port; runs as root (non-root, read-only root filesystem, no
capabilities).

**Egress.** HTTPS `POST` to `<trustivan.url>/api/v1/kubernetes/clusters/<clusterId>/response/claim`
and `.../response/actions/<id>/result` with the sensor's key, and the cluster's
API server.

**Verify.** `kubectl get clusterrole trustivan-runtime-responder -o yaml`, and
the audit trail's `runtime_response.*` entries for every action it took.

## Kubernetes collector

Agentless: nothing is installed in the cluster. The TRUSTIVAN deployment calls
your API server with a ServiceAccount token you create. See
[Cloud and Kubernetes](/configuration/cloud-and-kubernetes#kubernetes).

**Reads.** With `get` and `list` only: namespaces, pods, service accounts,
resource quotas, limit ranges, services, deployments, stateful sets, daemon
sets, jobs, cron jobs, network policies, ingresses, roles, cluster roles and
their bindings, and `/version`. That is the whole ClusterRole the **Connect
cluster** dialog gives you.

**Never.**
- No write: the collector sends only `GET` requests, and the ClusterRole grants
  no write verb.
- No Secret: `secrets` is not in the ClusterRole and the collector requests no
  Secret path. From a container's environment it keeps which variables come
  from a Secret or hold a literal credential: the name, never the value.
- No private key: an Ingress contributes the host names in its `spec.tls`, not
  the certificate Secret it names.

**Network.** Outbound from the TRUSTIVAN deployment to your API server's https
URL, inbound to your cluster. A URL that resolves to a loopback, private or
link-local address is refused unless the deployment's operator allows it
(`KUBERNETES_ALLOW_PRIVATE_CLUSTERS`), and the check is repeated at every
collection against the resolved address.

**Verify.** `kubectl auth can-i --list --as=system:serviceaccount:kube-system:trustivan-collector`;
your API server's audit log shows only `get` and `list` from that identity.
The token is a bound token with an expiry, so it lapses unless you renew it.

## Cloud collectors (AWS, Azure, Google Cloud)

Agentless: they run on the TRUSTIVAN deployment and call the provider's APIs
with the read-only identity you grant. See
[Cloud and Kubernetes](/configuration/cloud-and-kubernetes) and
[Cloud posture](/configuration/cloud-posture).

**Reads.** AWS: the actions in the generated policy, every one a `Describe`,
`Get` or `List` call (`sts:AssumeRole` appears only in the trust policy, for role
connections). Azure: the built-in **Reader** role, plus **Key Vault Reader**
for vault certificates. Google Cloud: **roles/viewer** and
**roles/iam.securityReviewer**.

**Never.**
- No write: no write permission is asked for. The only `POST` requests are
  OAuth token requests and Google's `getIamPolicy`, which reads.
- No stored long-lived secret where you can avoid it: AWS role connections
  store none, and need the external ID TRUSTIVAN issues. Azure and Google Cloud
  need a client secret or key file, stored encrypted and never readable back
  through the API.
- No private key: certificate services are read for the public certificate and
  chain only.

**Network.** Outbound from the TRUSTIVAN deployment to the provider's API and
token endpoints. Google tokens are always requested from Google's own endpoint,
whatever the key file says.

**Verify.** CloudTrail, the Azure activity log and Google Cloud audit logs show
the identity's calls. `TestThePublishedPoliciesGrantEveryActionTheCollectorCalls`
(in `backend/internal/cloud/aws`) fails if the collector calls an action the
published policy does not list.

## `trustivan` CLI and the GitHub Actions

The CLI runs where you run it, usually a CI runner. See
[`trustivan`](/cli-reference/trustivan), [GitHub Actions](/integrations/github-actions)
and [the tls-check Action](/configuration/certificates#the-tls-check-github-action).

**Reads.** `TRUSTIVAN_URL` and `TRUSTIVAN_API_KEY` from the environment.
`scan` and `gate` send a reference (an image name, or a repository URL and
ref) and TRUSTIVAN fetches the target itself. `secrets scan` reads the staged
diff (`git diff --cached`). `tls-check` reads its host list and an optional CA
file.

**Never.**
- No listening port: every command is a client.
- `scan` and `gate` upload no file from the runner; they only write the SARIF
  file you ask for with `--sarif`.
- `secrets scan` and `tls-check` talk to no TRUSTIVAN server and need no key.
  `secrets scan` prints where a secret is, the rule and at most its first four
  characters followed by a fixed-width mask, never the whole value.

**Egress.**
- `scan`, `gate`: requests to `TRUSTIVAN_URL` under `/api/v1/scans` only. Plain
  `http` to a non-loopback address works and prints a warning, because the key
  would travel in clear.
- `tls-check`: a TLS handshake to each host and port you list (several, to test
  which versions are accepted), and CAA lookups over UDP to the first name
  server in `/etc/resolv.conf`.
- The `tls-check` Action also downloads Go with `actions/setup-go` (pinned by
  commit) and the module dependencies to build the tool on the runner.

**Verify.** Run the command under a proxy or with egress restricted to your
TRUSTIVAN host; read `backend/cmd/trustivan` and `actions/tls-check/action.yml`,
which are the whole of what runs.

## MCP server

Two forms with the same tools. `trustivan mcp` runs locally as your
assistant's subprocess; the hosted endpoint is `POST /api/v1/mcp` on the
TRUSTIVAN deployment. See [MCP server](/integrations/mcp-server).

**Reads.** Only what the API key's scopes allow, through the ordinary API:
findings, assets, posture, compliance status and the check catalogue.

**Never.**
- The local server opens no port: it speaks MCP over standard input and output.
- No tool reads your files, your repository or your environment; every tool is
  an API request with your key.
- No write without a write scope on the key, and the local server offers no
  writing tool at all with `--read-only`. The three writing tools (suppress a
  finding, set an asset's owner, open a fix pull request) are refused by the API
  when the key lacks their scope.

**Egress.** Local: requests to `TRUSTIVAN_URL` under `/api/v1` only. Hosted:
none from your machine beyond your assistant's connection to the endpoint; the
tools run inside the deployment.

**Verify.** `tools/list` shows exactly what is offered; the
[audit trail](/concepts/audit-trail) records every write made with the key.
