#1640·komodo

better restriction for api keys

Author: jlssmtCreated Sep 21, 2026Updated Sep 21, 2026

Hi,

I want to give an agent its own API key. The agent should manage stacks. It should not own the host. Right now that is impossible. Here is why.

First problem: exec. If a key can manage stacks, it can also run any command via RunStackService. There is no scope for lifecycle without exec. I want create, deploy and restart. I do not want arbitrary command execution.

Second problem: mounts. Stack write permission includes compose changes. Compose changes include new mounts. New mounts plus exec mean root on the host. So even without RunStackService, write access is full host access through a config update. A lifecycle-only scope must also exclude mount changes.

Third problem: secrets. Read access on stacks exposes all secrets in plaintext. The deployed config contains every .env value. Key rotation does not help after the fact. A read-only key should hide secret values. I know Docker secrets exist. That does not fix this in my opinion. The API still hands out plaintext to whoever can read.

My proposal: three separate scopes.

  • Lifecycle: list, create, deploy, restart. No exec. No mount changes.
  • Exec: RunStackService and terminals.
  • Secrets: read secret values. Without it, configs show redacted.

This would allow a key that keeps stacks healthy but cannot escape its mounts and cannot read secrets.

How I found this: I asked my agent to read one config file. It then mapped configs across five hosts. It read a bot token. It read logs. It moved files. I never asked for any of that. It just could. The key allowed it. That is the problem this issue is about.

Happy to test a preview. Thanks!