Skip to content

Vault

How mikan stores credentials in the state directory and injects env or file mounts by sandbox mode.

The default state directory is:

~/.mikan/

Important contents include:

~/.mikan/
├── settings.json
└── vaults/
└── <vault-id>/

You can also specify it with --state-dir:

Terminal window
mikan --state-dir=/secure/mikan-state --sandbox=container:mikan-tools /path/to/workspace

Credentials are then stored in:

/secure/mikan-state/vaults/

The global settings file is at <state-dir>/settings.json. Conversation overrides are host-only at <state-dir>/conversations/<conversationId>/settings.json. A legacy <working-directory>/<conversationId>/settings.json is migrated once, then ignored.

At startup, mikan refuses a --state-dir that is world-writable or not owned by the current user. Newly created state/vault directories and credential files use private modes, but an existing group/world-readable state directory is not automatically tightened; use chmod 0700 <state-dir>.

Each vault is a directory under vaults/ and may contain:

  • env file: environment variables in KEY=value form
  • file credentials: for example gws.json, .ssh/config

mikan infers mount targets from file names/paths, such as gws.json/root/.config/gws/credentials.json and .ssh//root/.ssh. In image mode these credential mounts are writable from inside the sandbox, so tools may update them; keep backups for credentials whose mutation would matter.

Example:

~/.mikan/vaults/
└── container-mikan-tools/
├── env
└── gws.json

env example:

GH_TOKEN=ghp_xxx
GITHUB_OAUTH_ACCESS_TOKEN=gho_xxx
Sandbox modeVault env injectionFile credential projectionVault key
hostnot injectednot projectedcredentials can be stored, but not injected into host commands
container:<name>injectednot projectedcontainer-<name>
image:<image>injectedautomatically projectedgenerated conversation vault, usually the conversation ID
firecracker:*injectednot projectedgenerated conversation vault
cloudflare:*injectednot projectedgenerated platform-scoped conversation vault

In a DM / private message, run:

/login

mikan creates a 15-minute onboarding link. In the web page, users can store:

  • arbitrary API keys / env vars
  • GitHub OAuth credentials
  • Google Workspace CLI OAuth credentials

/login only works in DMs / private messages so other people in shared channels cannot obtain a credential onboarding link.

For production deployments, set the public URL:

Terminal window
export LINK_URL="https://mikan.example.com"

If LINK_PORT is not set, mikan defaults to port 8181 when LINK_URL exists.

You can also set it explicitly:

Terminal window
export LINK_PORT=8181

For local testing, you can set only:

Terminal window
export LINK_PORT=8181

The /login link will then use:

http://localhost:8181

OAuth callback URL is:

<LINK_URL>/oauth/callback