Skip to content
Open Source AI Agent Platform

AI agent security on an open-source agent, control by control

AI agent security is the control of what an agent may reach, which credentials it can read, and who can widen either. Kortix, the open-source CompanyOS, declares the reach and the grants in files in a git repo, so a reviewer reads them instead of a console. That is my pick, and I work on Kortix's marketing, so weigh that accordingly. The controls follow the order a security review does.

The manifest a reviewer opens first

kortix.yaml
Source:https://github.com/kortix-ai/CompanyOS/blob/dev/packages/starter/templates/base/kortix.yaml
agents:  worker:    description: "General-purpose worker: coding, research, writing, ops and data work, done end to end in its own sandbox."    mode: primary    permission: allow    prompt_file: agents/worker.md    # "*" is every name (quoted: a bare * is a YAML alias). `all` means the same.    tools: "*"    skills: "*"    connectors: "*"    secrets: "*"    kortix_permissions: "*"

The starter's worker block writes "*" for every grant, which is every name, and points at agents/worker.md for the prompt. The manifest reference gives the rule behind the list: "A registered item reaches no agent until an agent enables it."

What changes when the agent has a machine

An agent differs from a chatbot in where the damage lands. A chatbot returns text. An agent runs commands on a machine, holds a session open, and acts on systems outside it, so a mistake leaves the conversation and reaches production.

Model guardrails answer a different question. They decide what a model will say, not which database a scheduled run can reach at 02:00 with nobody watching. An agent that keeps working after the chat window closes needs controls around the machine, the credentials it holds, and how either can be widened.

Kortix declares the reach of each agent in the workspace repository: one manifest, one file per agent, and the change records around them. A reviewer reads the declaration and its history. The secret values and their exposure sit in the secrets manager, which is the next boundary.

Three risks that follow the machine

An agent that can run a shell can leak whatever is in its environment. A prompt injection that reaches a shell command can print a token, and that machine often holds several. The exposure of each secret decides whether the leak is a rotated key or an incident.

Reach grows one connector at a time. A workspace starts with one agent and a few secrets, then adds an agent for support, one for releases, and a connector for each system they touch. Nobody sits down to widen the blast radius; it accumulates quietly.

A rule change nobody can reconstruct is the third risk. When an allow-list lives in a console, the person who widened it two quarters ago may have left, and the screenshot does not say who clicked.

The identity the agent acts as

An agent that acts as a person's login cannot be separated from that person in a log. The manifest gives each agent its own entry in agents:, and its grants bound what that entry can reach.

An agent is agents/<name>.md for its prompt plus an agents.<name> block in kortix.yaml for everything else. The block names the prompt file, the mode, the agent's own permission line, which is allow in the starter, and the grants for connectors, secrets, Kortix permissions and skills. Its access is what kortix.yaml grants it.

Grants in the manifest are deny by default. Skills, subagents, commands, extensions, connectors, secrets and Kortix permissions all start at none. The agent block writes "*", none or a list of names before an agent reaches any of them, so the specialist you add next month starts locked down. Widening it arrives as a commit with an author and a review. The starter's own worker agent writes "*" for every grant, deliberately, so a fresh workspace is capable on the first day. Narrow them once you know what the workspace needs.

Who may widen a grant is a permission of its own, whether the caller is a person or an agent. The permissions and policy page covers that side of the model.

Where the credentials sit

Secret names are declared in the manifest and their values are stored in the secrets manager, never in the repo. A new value defaults to environment exposure. The session receives the real value, and any command the agent runs can read it, print it, or send it somewhere. Kortix cannot redact that use.

The egress-enforced option is an experimental per-secret choice behind the workspace flag secrets_egress. The sandbox holds a handle, Kortix substitutes the real value outside the sandbox on the exact HTTPS hostnames you list, and an echoed value comes back as [REDACTED]. A value the code has to compute with, such as a webhook signing secret, an SSH key or HTTP Basic auth, stays on environment exposure.

Connector credentials sit on the other side of that line. Connector credentials are brokered server-side and never enter the machine.

Each secret also has an audience: everyone in the workspace, one person, or named people, groups and agents. Shared sessions, triggers and webhooks act for nobody, so those runs receive only values shared with everyone. Narrow the audience before you need to.

What a session can touch

One isolated sandbox per session. Each session has its own isolated machine and branch. The branch is cut from the repo, and the agent commits and pushes to its own branch, so a bad command costs a sandbox and not the repository. Only what it pushes survives the machine.

The manifest accepts a network_egress declaration, and the manifest reference is direct about what it does: the field is a declaration only, and egress is not enforced. Treat outbound reach as open. Place the boundary you rely on at the credentials, and read the sandboxing page for what the machine does and does not contain.

What the log keeps

Every action is recorded. Reading, exporting and streaming the audit log depend on the plan.

Kortix shows the last 14 days in the log. Events from 14 to 365 days old stay in a locked archive that nobody can shorten or delete, and the export (CSV or JSONL) reads them back. If your incident window is a year, export on a schedule into storage you control. The retention windows are documented on Kortix.

How a rule change is reviewed

Because reach is declared in files, a change to an agent's reach is a diff. The grant sits in the manifest, the behavior sits in the agent file, and each commit carries an author and a message that says why.

Session work reaches main through a change request. Merge is default-deny for agents, so an agent can propose a wider grant and cannot land it alone. A session cannot merge a change request it opened unless its grant in kortix.yaml includes project.gitops.merge, which an admin can add. A console setting produces a screenshot with no author, no diff and no rollback. That is what a reviewer is testing for when they ask how a permission was granted.

How the running version is pinned and updated

A self-hosted instance is one Docker Compose stack on a server you control. Images follow a channel: stable, a release Kortix promotes to self-hosted instances after it runs in production, or latest, which is every release. --tag pins one exact version and wins over the channel.

The daily updater runs the database migration before it swaps anything. When a migration fails, nothing is swapped and the previous version keeps serving, which also makes it the rollback target. kortix self-host status reports the last outcome and compares the running images against the configuration.

What the operator still owns

The update hour is yours. kortix-updater checks once a day at KORTIX_UPDATE_TIME, 02:00 by default, in the timezone set by KORTIX_UPDATE_TZ. Move it to a window you can watch.

Backups are yours. Stop the stack, copy ~/.config/kortix/self-host/<instance>/ and its four Docker volumes somewhere else, then start it again. The directory holds .env, the Postgres data and the stored files; the volumes hold db-config, kortix-capture-data, kortix-caddy-data and kortix-updater-state. A restore puts both back in place.

The key is yours. API_KEY_SECRET in .env encrypts every stored secret, so losing it makes each one unreadable, and replacing it has the same effect. The CLI warns before a change and refuses to rotate that key on its own.

The first hour is yours. Until EMAIL_URL is set or DISABLE_SIGNUP=true, a new instance confirms sign-ups without an email, and kortix self-host doctor fails that state as open-sign-up. Run the doctor, fix what fails, and keep its output for the review.

The evidence pack a reviewer reads in an hour

The pack is five items, and a reviewer can read all five in an hour.

  • The manifest at the repo root.
  • Each agent's markdown file, with its permission line.
  • Every change request that touched a grant or a secret in the period.
  • The output of kortix self-host doctor.
  • The backup and rotation runbook, with a name against each step.

The first two show the intended reach. The third shows how that reach changed, and who changed it. The last two show whether the instance is operated the way the files say it is.

What this does not solve

A model can still be talked into a bad action. Isolation limits where that action runs, and it does not make the judgment correct.

A secret delivered as an environment value is readable by any command the agent runs, so a prompt injection that reaches a shell can print it. The experimental egress-enforced option narrows that for HTTPS credentials, and it does nothing for a value the code has to compute with.

Network egress is declared in the manifest and not enforced. Outbound reach is a separate control that you place, on the network or at the proxy.

Name those three before a reviewer asks. A review that hears them from you spends its hour on the controls you do have.

Questions that arrive before the review

What is AI agent security?

AI agent security is the practice of bounding an agent's reach: what it may act on, what it may read, and who may extend that reach. An agent with its own machine widens the practice, since a token it reads or a command it runs reaches beyond the conversation.

Can AI be used for security?

Yes. Agents read logs, triage alerts, and draft the fix while a queue of tickets waits. The limit is reach: an agent that can read production credentials is a new attack surface, so scope what it can touch before you point it at an incident.

Which AI is best for security?

No single model settles that question. For security work, pick an agent whose sessions run on isolated machines, whose connector credentials stay outside them, and whose rule changes arrive as commits a reviewer can read. That is the test to apply to Kortix.

Is a self-hosted agent more secure than a hosted one?

It moves the boundary, and the work, to you. You hold the server, the database and the key that decrypts every stored secret, and you take on patching, backups and the update hour. A hosted instance leaves those with an operator you have to trust.

Put the controls where a reviewer can read them

Self-host Kortix, then hand over the manifest, the agent files and the doctor output.