Introducing kosem. Coding agents with native environments, identity and access · kosem

· kosem ·

12 min read Original article ↗

Blog

Coding agents are reliving the mainframe era. People shared one central computer through terminals: a single heavy job slowed down the whole room, and even after each person had a separate user, everyone still shared one operating system. That era ended when every person got their own computer, operating system and identity.

Today, the developer's laptop is that mainframe, and coding agents are the users at its terminals. They share one operating system, one filesystem and the developer's credentials, while the developer babysits them across a row of terminal tabs.

Today we're introducing kosem: coding agents with native environments, identity and access. Each agent runs in an isolated environment, acts under a distinct identity and has only the access you grant it, instead of borrowing your laptop and keys. kosem is open in public beta: get started with $10 in starter credits, or read on for why today's setup breaks and how kosem works.

Here's what one task looks like in kosem, from the first prompt to an open pull request:

acme / checkout / Agents

Find why checkout returns 502sDone

MayaCheckout's API has returned 502s since this morning's deploy. Find out why, fix it and open a pull request.

I'll clone checkout, read the errors since the deploy and find what it changed.

Started environment from acme/checkout-dev · Small · 1 vCPU

Issued github/acme · acme/checkout · read · 60 min, granted without asking

$ git clone https://github.com/acme/checkout 4.1s

$ git log --oneline -2 0.1s

a41c9e2 payments: share one HTTP client (#1427)
7d03b18 checkout: retry idempotent writes (#1425)

The 502s are in CloudWatch. Reading them requires aws/prod-logs, which needs your approval.

Can I use aws/prod-logs for one command? Maya approved · this command · one log group

Issued aws/prod-logs · one log group · this command · source identity agent:ags_01m9…r7tx

$ aws logs filter-log-events --log-group-name /prod/checkout-api --filter-pattern 502 1,284 events

upstream payments: context deadline exceeded (Client.Timeout 2s)

The credential expired as the command ended

a41c9e2 switched payments to the shared fraud-check HTTP client, which has a 2 s timeout, while payments can take up to 6 s. I'll restore a separate HTTP client for payments.

internal/payments/client.go+3−1

  func NewClient(cfg Config) *Client {-   return &Client{http: shared.HTTP} // 2s timeout shared with fraud check+   return &Client{http: &http.Client{+     Timeout: 10 * time.Second,+   }}  }

The integration tests build the whole service, which crawls on 1 vCPU. I'm moving to Large for the build.

Restarted at Large · 4 vCPUs · 16 GiB, on the same disk, within your limit

$ make test-integration 212 passed · 3m 08s

Back to Small · 1 vCPU, as the build is done

Issued github/acme · acme/checkout · contents and pull requests: write · 60 min

$ gh pr create --fill #1432

#1432 Give payments its own HTTP client lint build integration

Opened #1432, which restores the 10 s timeout for payments. It's yours to review.

Idle, so its environment stopped. Its disk is retained for 7 days

Reply to the agent…best

Go idle0:47 / 0:47

One task in kosem, from the first message to the pull request.

Why today's coding agents break

Today's coding agents run on the developer's laptop, as the developer, and that breaks in two ways. The biggest is security. Then come performance and productivity.

Security

An agent needs what a developer needs to get work done: private code and secrets, text from strangers in issues, docs and dependencies, and a way to push and call out. That's Simon Willison's lethal trifecta,[1] and it can't be designed away, since the work needs all three. Any text the agent reads can carry a prompt injection, so it needs defense in depth across three layers. On a laptop, only the first layer is there:

  • The model. System prompts and training teach it to follow the developer rather than what it reads, and models keep getting better at it. Anthropic says that isn't enough: prompt injection is "far from a solved problem."[2]
  • Least privilege. An injection that gets through should access only what the task needs. On a laptop, the agent runs as the developer, so one injection exposes everything: their GitHub and cloud credentials, their SSH keys and every repo on their disk.
  • Audit. Afterwards, the team needs to see what the agent read and ran, what to roll back and what to rotate, and trace each commit and cloud call back to it. On a laptop, every action is logged as the developer, and the transcript sits in their home directory, where the agent can rewrite it and Claude Code deletes it after 30 days by default.[3]

The patches on top mostly add friction. Approval prompts aren't a security boundary,[4] and Anthropic says they lead to "approval fatigue."[5] OS sandboxes share the laptop's kernel, the docs say not to rely on them "to stop a malicious command,"[6] and they break tools like docker.[7] So everyone ends up running --dangerously-skip-permissions, which is a little unfair to the flag: without it, the agent was almost as dangerous.

Performance and productivity

The second set of problems comes from sharing one machine. Every agent on a laptop competes for the same resources, and each parallel task makes it worse:

  • They step on each other's toes. Agents on one laptop share its ports, Docker daemon, databases and often its working tree. One agent switches branches under another, a test run binds the port a dev server needs and a migration resets a database another suite is testing against. Git worktrees separate the files, not the rest.
  • They compete for the same cores. One agent's 10-minute build takes every core, stalling the other agents and the developer's editor. A laptop can't grow for a heavy build and shrink back while the agent reads code.
  • Their work stays trapped on one laptop. The transcript, the branch and the half-done work belong to one machine. A teammate can't see how a fix was verified, steer an agent while its developer is out, or pick up the task where it stopped.
  • They keep the developer babysitting tabs. Long-running tasks need a machine that stays up for hours. Close the lid or lose Wi-Fi on a train and the agent stops mid-task, so the developer leaves the laptop open and watches a row of terminal tabs.

Both sets of problems have one cause: the agent borrows the developer's laptop and identity. So the boundary belongs in two places. Around execution: each agent gets an isolated environment, with its own kernel and none of the developer's files, so it can run freely. And at the edge, where it reaches the outside world: its own identity, only the credentials its task needs, and a record of everything it did with them. Two developers don't share a laptop or an account, and two agents doing different tasks shouldn't either.

What kosem is and how it works

In kosem, each agent gets three native pieces: an isolated environment, a distinct identity with only the access its task needs, and models through one gateway. Around the agents, the team gets IAM for its people and an audit trail the agent can't touch. We'll cover how we built environments, access and audit in separate posts.

Your team

MMayaStarts and steers the agent

DDavidApproves what's on prompt

Sets the permission set, the size limit and the budget once

signs in

IAM for people
  • MMayaAgents Useron project checkout
  • DDavidSecret Accessoron secret aws/prod-logs
  • SSamAgent Vieweron agent ags_…r7tx
Roles on the organization, its projects and single resources, such as one secret. Agents have no IAM roles.

who can start, read and steer it

Agent

agent:ags_01m9…r7txDirected by Maya

Its own identityNo static keysTranscript stored in kosem

calls models

LLM Gateway
Model
best
This agent
$3.18
Project
$412 of $2,000
Keys stay in kosem, outside the agent's environment

on your accounts

Model providers

Anthropic

OpenAI

Google Gemini

Your own server

runs commandsasks for access

Environments A fleet of microVMs, one for each agent, each from its team's image

RunningStoppedRunningRunning

This agent's microVMLarge · 4 vCPUs · building Disk persists while idle Credential broker

Its own kernel, root and DockerResized within the team's limit

asks · issues

IAM for agents

The team's permission setgrantedgithub/acmepromptaws/prod-logs · David approvesoffEverything else · hidden

Task leaseGitHub · acme/checkout · 60 minAWS · one log group · one commandMinted on demand by the broker, scoped to the request. Ends with the task.

mints, narrowed

Integrations

GitHubApp installation token, scoped to reposAudit log · hashed_token

AWSAssumeRole with a session policyCloudTrail · accessKeyId

Google CloudShort-lived access tokenCloud Audit Logs

records every credential

Audit
  1. Maya started agent:ags_…r7tx
  2. agent:ags_…r7tx was issued github/acmehashed_token 3f9a…c1
  3. David approved aws/prod-logs · one command
  4. agent:ags_…r7tx was issued aws/prod-logsaccessKeyId ASIA…7Q2M

joined on the ID

kosem's building blocks, around one agent.

Agent

The kosem agent runs on our own harness, built for the platform rather than bolted onto a CLI in a container. Its environment, model calls, secret requests and transcript are native to it: long builds run as background jobs, the agent asks a teammate only when it needs a decision or an approval, and it sees a pull request through its checks.

Because every agent lives in kosem rather than a local terminal tab, you see what's working, what needs you and what's done in one place. In the task above, Maya hands off a checkout 502 investigation and comes back to a tested fix and an open pull request.

Environment

Each agent runs in an isolated microVM with its own kernel, adjustable CPU and memory, a persistent disk and any OCI image from your registry, so it starts with the team's languages, databases and tools. The agent is root and runs Docker inside it, with none of the developer's files present, so it doesn't have to ask before each command.

The agent sizes its environment to the step within the team's limit: small while reading code and editing files, then scaling up for heavy builds or integration tests, as in the checkout run above, before shrinking back down. When the agent goes idle waiting on an answer, its environment stops while its disk persists, so it resumes where it left off in seconds. Teams run tasks in parallel without port collisions, stalled editors or open laptops.

Identity and access

Every agent is a distinct principal, agent:ags_…, and starts with no access at all. The team grants it specific secrets, and nobody can grant more than they have: giving an agent a secret requires access to it.

For GitHub, AWS and Google Cloud, kosem mints short-lived credentials on demand, scoped to the request, so no long-lived key enters the environment. Static secrets are the exception, for services that can't mint short-lived tokens yet.

Each secret on an agent is set to granted, prompt or off. The agent uses granted secrets without asking (like github/acme to clone and open a pull request), pauses for a teammate's approval on prompt secrets (like aws/prod-logs for one log query), and never sees anything left off. When the task ends, its access ends with it.

Models

Agents call models through one gateway: any model the team turns on across Anthropic, OpenAI, Google Gemini, Vertex AI or a compatible self-hosted server. Provider keys stay sealed in kosem and never reach an agent or a person. Your providers bill tokens directly on your contracts, with zero markup from kosem.

The organization chooses which projects can use which models, and sets monthly spend limits for itself and for each project. Usage breaks down by project, model and agent, so every dollar ties back to the work it paid for.

People and projects

People get separate permissions from agents. One organization contains your people and projects, shaped the way your teams work: a project per team or service, and groups for the people who work together.

Granular roles decide who can do what at the organization, project or single-resource level, for a person or a whole group. You can split who views, starts and steers a project's agents, who can access which secrets and who can grant them to agents. Billing, members, policies and the audit log each have separate roles, so nobody needs blanket admin rights.

Agents are shared with their project by default, so a teammate can read a run, answer a question, approve a prompt request or pick a task up where it stopped. An agent can also be private, visible only to the people you choose.

Audit

kosem keeps an immutable record of what happened, outside the agent's environment where the agent can't touch it. The full transcript, every message, command and result, lives in kosem, alongside logs for creating an agent, granting a secret, changing a role or reading a transcript.

Each minted credential is logged under the agent's identity with GitHub's hashed_token or CloudTrail's accessKeyId, so you can join kosem's audit log directly with the provider's logs. In AWS, the agent's ID is set as the session's source identity, so CloudTrail names which agent made each call. Commits carry Assisted-by and Kosem-Agent trailers too, giving security teams a straight line from a commit or cloud call back to the exact run when they need to verify, roll back or rotate.

Get started

kosem is open in public beta. Get started on the Hobby plan with $10 in starter credits, connect your model provider and give your first agent a task.

Evaluating kosem for an organization? Compare plans on pricing, or get in touch.

Every agent starts with an isolated environment and no access. Grant it what the task needs, follow its work from your laptop or phone and steer it together with your team.

Notes

  1. Simon Willison, The lethal trifecta for AI agents, June 2025. ↩
  2. Anthropic, Mitigating the risk of prompt injections in browser use, November 2025. ↩
  3. Claude Code's docs: cleanupPeriodDays. ↩
  4. Claude Code's docs: Configure permissions and Choose a permission mode. ↩
  5. Anthropic, Beyond permission prompts: making Claude Code more secure and autonomous, October 2025. ↩
  6. Claude Code's docs: Configure the sandboxed Bash tool, and its security limitations. ↩
  7. Claude Code's docs: docker commands fail. ↩