# Mikoshi documentation (full text)

> Index: https://www.mikoshi.digital/docs/llms.txt

# Introduction

Source: https://www.mikoshi.digital/docs/introduction

> AI hackers to secure your apps

Mikoshi are autonomous AI agents that act like real hackers—they run your code dynamically, find vulnerabilities, and validate them with proof-of-concepts. Built for developers and security teams who need fast, accurate security testing without the overhead of manual pentesting or the false positives of static analysis tools.

<Frame>
  <img src="/images/screenshot.png" alt="Mikoshi Demo" />
</Frame>

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="https://www.mikoshi.digital/docs/quickstart">
    Install and run your first scan in minutes.
  </Card>
  <Card title="CLI Reference" icon="terminal" href="https://www.mikoshi.digital/docs/usage/cli">
    Learn all command-line options.
  </Card>
  <Card title="Tools" icon="wrench" href="https://www.mikoshi.digital/docs/tools/overview">
    Explore the security testing toolkit.
  </Card>
  <Card title="GitHub Actions" icon="github" href="https://www.mikoshi.digital/docs/integrations/github-actions">
    Integrate into your CI/CD pipeline.
  </Card>
</CardGroup>

## Use Cases

- **Application Security Testing** — Detect and validate critical vulnerabilities in your applications
- **Rapid Penetration Testing** — Get penetration tests done in hours, not weeks
- **Bug Bounty Automation** — Automate research and generate PoCs for faster reporting
- **CI/CD Integration** — Block vulnerabilities before they reach production

## Key Capabilities

- **Full hacker toolkit** — Browser automation, HTTP proxy, terminal, Python runtime
- **Real validation** — PoCs, not false positives
- **Multi-agent orchestration** — Specialized agents collaborate on complex targets
- **Developer-first CLI** — Interactive TUI or headless mode for automation

## Security Tools

Mikoshi agents come equipped with a comprehensive toolkit:

| Tool | Purpose |
|------|---------|
| HTTP Proxy | Full request/response manipulation and analysis |
| Browser Automation | Multi-tab browser for XSS, CSRF, auth flow testing |
| Terminal | Interactive shells for command execution |
| Python Runtime | Custom exploit development and validation |
| Reconnaissance | Automated OSINT and attack surface mapping |
| Code Analysis | Static and dynamic analysis capabilities |

## Vulnerability Coverage

| Category | Examples |
|----------|----------|
| Access Control | IDOR, privilege escalation, auth bypass |
| Injection | SQL, NoSQL, command injection |
| Server-Side | SSRF, XXE, deserialization |
| Client-Side | XSS, prototype pollution, DOM vulnerabilities |
| Business Logic | Race conditions, workflow manipulation |
| Authentication | JWT vulnerabilities, session management |
| Infrastructure | Misconfigurations, exposed services |

## Multi-Agent Architecture

Mikoshi uses a graph of specialized agents for comprehensive security testing:

- **Distributed Workflows** — Specialized agents for different attacks and assets
- **Scalable Testing** — Parallel execution for fast comprehensive coverage
- **Dynamic Coordination** — Agents collaborate and share discoveries

## Quick Example

<CodeGroup>
```bash Vercel AI Gateway
# Install
curl -sSL https://www.mikoshi.digital/install | bash

# Configure
export MIKOSHI_LLM="vercel_ai_gateway/zai/glm-5.3"
export LLM_API_KEY="your-api-key"

# Scan
mikoshi --target ./your-app
```

```bash OpenRouter
# Install
curl -sSL https://www.mikoshi.digital/install | bash

# Configure
export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
export LLM_API_KEY="your-api-key"

# Scan
mikoshi --target ./your-app
```
</CodeGroup>

## Support

<Card title="Support" icon="envelope" href="https://www.mikoshi.digital/contact">
  Questions, bugs, and feature requests.
</Card>

<Warning>
Only test applications you own or have explicit permission to test.
</Warning>

# Quick Start

Source: https://www.mikoshi.digital/docs/quickstart

> Install Mikoshi and run your first security scan

## Prerequisites

- Docker (running)
- An LLM API key from any [supported provider](https://www.mikoshi.digital/docs/llm-providers/overview) (OpenAI, Anthropic, Google, etc.)

## Installation

<Tabs>
  <Tab title="curl">
    ```bash
    curl -sSL https://www.mikoshi.digital/install | bash
    ```
  </Tab>
  <Tab title="Download">
    Download a binary for macOS, Linux, or Windows from [mikoshi.digital/download](https://www.mikoshi.digital/download), extract it, and put `mikoshi` on your `PATH`.
  </Tab>
</Tabs>

## Configuration

Set your LLM provider. We recommend GLM-5.3 through [Vercel AI Gateway](https://www.mikoshi.digital/docs/llm-providers/vercel-ai-gateway) or [OpenRouter](https://www.mikoshi.digital/docs/llm-providers/openrouter):

<CodeGroup>
```bash Vercel AI Gateway
export MIKOSHI_LLM="vercel_ai_gateway/zai/glm-5.3"
export LLM_API_KEY="your-api-key"
```

```bash OpenRouter
export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
export LLM_API_KEY="your-api-key"
```
</CodeGroup>

<Tip>
For best results, use `zai/glm-5.3`, `deepseek/deepseek-v4.1-flash-1017`, `anthropic/claude-opus-5-5` (needs [CVP](https://support.claude.com/en/articles/14604842-cyber-verification-program) access), or `openai/gpt-6.1-sol` (needs [Daybreak](https://openai.com/daybreak/) access).
</Tip>

## Run Your First Scan

```bash
mikoshi --target ./your-app
```

<Note>
First run pulls the Docker sandbox image (`ghcr.io/khkstudios/mikoshi-sandbox`) automatically. The image is private: pulling it requires access granted by Mikoshi ([contact us](https://www.mikoshi.digital/contact)). Results are saved to `mikoshi_runs/<run-name>`.
</Note>

## Target Types

Mikoshi accepts multiple target types:

```bash
# Local codebase
mikoshi --target ./app-directory

# GitHub repository
mikoshi --target https://github.com/org/repo

# Live web application
mikoshi --target https://your-app.com

# Multiple targets (white-box testing)
mikoshi -t https://github.com/org/repo -t https://your-app.com

# Targets from a file, one target per non-empty, non-comment line
mikoshi --target-list ./targets.txt
```

## Next Steps

<CardGroup cols={2}>
  <Card title="CLI Options" icon="terminal" href="https://www.mikoshi.digital/docs/usage/cli">
    Explore all command-line options.
  </Card>
  <Card title="Scan Modes" icon="gauge" href="https://www.mikoshi.digital/docs/usage/scan-modes">
    Choose the right scan depth.
  </Card>
</CardGroup>

# CLI Reference

Source: https://www.mikoshi.digital/docs/usage/cli

> Command-line options for Mikoshi

## Basic Usage

```bash
mikoshi (--target <target> | --target-list <path>) [options]
```

## Options

<ParamField path="--target, -t" type="string">
  Target to test. Accepts URLs, repositories, local directories, domains, IP addresses, API spec files (OpenAPI/Swagger `.json`/`.yaml`, a Postman collection export), or a live Postman collection by id (`postman://<collection-uuid>`). Can be specified multiple times. Fresh runs require at least one target source: `--target` or `--target-list`.

  When the target is an API spec, Mikoshi copies it into the agent's workspace and authorizes the base URLs it declares (including those resolved from a Postman environment) as in-scope hosts - so the agent reads the contract and tests the full declared surface instead of discovering endpoints by crawling. Pair the spec with the deployed base URL (e.g. `--target ./openapi.yaml --target https://api.example.com`) so the agent has a reachable host to attack.

  <Note>
    A local directory is mounted into the sandbox live and **writable**, so the agent edits your real files (`.git` excepted). Commit or stash first.
  </Note>

  <Note>
    Fetching a Postman collection by id requires `POSTMAN_API_KEY`. Add `?env=<environment-uuid>` to also pull a Postman environment, which resolves `{{baseUrl}}` / token variables the collection references (e.g. `postman://<collection-uuid>?env=<environment-uid>`).
  </Note>
</ParamField>

<ParamField path="--target-list" type="string">
  Path to a file containing targets, one per non-empty, non-comment line. Lines starting with `#` are ignored. Can be specified multiple times and combined with `--target`.
</ParamField>

<ParamField path="--instruction" type="string">
  Custom instructions for the scan. Use for credentials, focus areas, or specific testing approaches.
</ParamField>

<ParamField path="--instruction-file" type="string">
  Path to a file containing detailed instructions.
</ParamField>

<ParamField path="--skills" type="string">
  Comma-separated skills to load into the root agent before the scan starts, for
  example `idor,mass_assignment,custom/my_method`. Use the bare name or
  `<category>/<name>`. Unknown names stop the run and list the available skills.
  See [Skills](https://www.mikoshi.digital/docs/advanced/skills#load-skills-yourself).
</ParamField>

<ParamField path="--skills-dir" type="string">
  Directory with extra skills, in the same `<category>/<name>.md` layout as the
  built-in set. Repeat the option for more directories. A skill with the same
  path as a built-in skill replaces it. Mikoshi also reads `MIKOSHI_SKILLS_DIR`. See
  [Add your own skills](https://www.mikoshi.digital/docs/advanced/skills#add-your-own-skills).
</ParamField>

<ParamField path="--workspace-file" type="string">
  Path to a file on your machine to place into the sandbox workspace before the
  scan starts. Repeat the option for more files. Write `PATH:DEST` to choose the
  destination inside `/workspace`. `DEST` defaults to the file name. See
  [Workspace files](https://www.mikoshi.digital/docs/usage/instructions#workspace-files).
</ParamField>

<ParamField path="--scan-mode, -m" type="string" default="deep">
  Scan depth: `quick`, `standard`, or `deep`.
</ParamField>

<ParamField path="--scope-mode" type="string" default="auto">
  Code scope mode: `auto` (enable PR diff-scope in CI/headless runs), `diff` (force changed-files scope), or `full` (disable diff-scope).
</ParamField>

<ParamField path="--diff-base" type="string">
  Target branch or commit to compare against (e.g., `origin/main`). Defaults to the repository's default branch.
</ParamField>

<ParamField path="--non-interactive, -n" type="boolean">
  Run in headless mode without TUI. Ideal for CI/CD. When no terminal is
  attached (CI, `nohup`, pipes) and a target is given, Mikoshi runs headless
  automatically and says so on one line.
</ParamField>

<ParamField path="--fail-on" type="string">
  Headless mode only (requires `-n`). Minimum severity that makes the run exit
  `2`: `critical`, `high`, `medium`, `low`, or `info`. Findings below the
  threshold are still written to every report artifact. A finding whose
  severity Mikoshi does not recognize always counts, so the gate never passes on a
  value it cannot rank. Omit the flag to exit `2` on any finding.
</ParamField>

<ParamField path="--blue, --no-blue" type="boolean" default="on">
  When the scan ends, write the blue-team report into the run directory:
  `blue_team_report.md`, `blue_team.json`, and `detections/` (Sigma, YARA, and
  Splunk/Elastic/Sentinel queries). On by default for headless and interactive
  runs. `--no-blue`, or `MIKOSHI_BLUE_TEAM=false` in the environment or config
  file, turns it off; the flag wins over the setting.

  The report is generated when the run wrote `vulnerabilities.json` (completed,
  budget-stopped, or interrupted runs alike) and for a completed run with no
  findings. Otherwise it is skipped. A resumed run regenerates it at its end.
  The step never changes the exit code. Its outcome is recorded in `run.json`
  under `blue_team` (`status`: `ok`, `skipped`, or `error`). To regenerate it
  later, run `mikoshi blue RUN`.
</ParamField>

<ParamField path="--blue-logs" type="string">
  Target log file for the blue-team detection-gap analysis (JSON lines,
  Apache/nginx combined, syslog, or text). Repeat for more files. A missing
  file is a warning in the report, not an error. Not allowed with `--no-blue`.
</ParamField>

<ParamField path="--config" type="string">
  Path to a custom config file (JSON) to use instead of `~/.mikoshi/cli-config.json`.
</ParamField>

<ParamField path="--max-budget" type="number">
  Maximum LLM spend in USD for the whole scan, counted cumulatively across the
  root agent and every child agent. The budget is checked after each model
  response.

  In non-interactive mode (`-n`), once the running cost reaches the threshold,
  the scan stops cleanly with a `stopped` status (not a failure) and the sandbox
  is torn down. Sub-agents are stopped early, at 90% of the budget, reserving
  the final slice for the root agent to wind down and produce the final report.

  In interactive mode, reaching the budget pauses the scan instead of ending
  it: every agent parks, and sending any message resumes the scan with the cap
  extended by the original budget amount. There is no sub-agent reserve in
  interactive mode.

  As the budget is approached, graduated wrap-up warnings are surfaced to
  **every** agent so they can finish their work and call their lifecycle tool
  before the hard stop. The bands sit just below each role's own stop point: the
  root is warned at **70%, 85% and 95%** (it stops at 100%), while sub-agents are
  warned at **75%, 80% and 85%** (they stop at the 90% reserve). In interactive
  mode every agent uses the **70%, 85% and 95%** bands. Percentages shown in the
  warnings are the real cumulative spend against the full budget.

  Must be greater than `0`. Omit the flag for no limit.

  **Limitations**

  - The check fires *after* a response is returned, so the final spend can
    slightly overshoot the limit by any calls already in flight when the
    threshold is crossed (most relevant with several child agents running
    concurrently).
  - Cost is a best-effort estimate derived from token usage and model pricing;
    providers that do not expose priced usage may under-count.
  - For LiteLLM-routed models, Mikoshi enables streaming success callbacks to
    capture provider-reported cost. Message content remains excluded, but
    third-party LiteLLM callbacks configured in the same process can receive
    other streaming metadata such as model names, request IDs, and token
    counts.
</ParamField>

<ParamField path="--max-turns" type="integer" default="500">
  Maximum number of turns (one model response plus its tool round) allotted to
  **each** agent, applied per run. When an agent reaches this limit it is
  force-stopped.

  As the limit is approached, graduated wrap-up warnings (at 70%, 85% and 95%)
  are injected into that agent's next model turn so it can prioritise its
  remaining work and call its lifecycle tool (`finish_scan` for the root agent,
  `agent_finish` for sub-agents) before the hard stop.

  Must be greater than `0`.
</ParamField>

## Examples

```bash
# Basic scan
mikoshi --target https://example.com

# Authenticated testing
mikoshi --target https://app.com --instruction "Use credentials: user:pass"

# Focused testing
mikoshi --target api.example.com --instruction "Focus on IDOR and auth bypass"

# CI/CD mode
mikoshi -n --target ./ --scan-mode quick

# CI/CD mode, failing only on high or critical findings
mikoshi -n --target ./ --scan-mode quick --fail-on high

# Blue-team report with a detection-gap check against the target's logs
mikoshi -n --target https://example.com --blue-logs ./access.log --blue-logs ./app.jsonl

# Skip the blue-team report
mikoshi -n --target ./ --scan-mode quick --no-blue

# Cap cost and per-agent turns
mikoshi --target https://example.com --max-budget 25 --max-turns 300

# Force diff-scope against a specific base ref
mikoshi -n --target ./ --scan-mode quick --scope-mode diff --diff-base origin/main

# Multi-target white-box testing
mikoshi -t https://github.com/org/app -t https://staging.example.com

# API spec + live target (OpenAPI/Swagger file or Postman collection)
mikoshi -t ./openapi.yaml -t https://api.example.com

# Postman collection pulled live by id (+ optional environment)
mikoshi -t "postman://<collection-uuid>?env=<environment-uuid>"

# Targets from a file
mikoshi --target-list ./targets.txt

# Extra files placed in the sandbox workspace
mikoshi --target ./my-project --workspace-file ./wordlist.txt
mikoshi --target https://app.com --workspace-file ./openapi.yaml:specs/openapi.yaml
```

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Scan completed successfully (interactive mode always exits `0`; in headless mode, `0` means no vulnerabilities were found, or with `--fail-on`, none at or above the threshold; lower findings are still in the report) |
| 1 | A fatal error occurred before or during the scan (e.g. missing environment variables, Docker unavailable, invalid config file, diff-scope resolution failure, or an unhandled error) |
| 2 | Vulnerabilities found (headless mode only; with `--fail-on`, at least one finding at or above that severity) |

# Scan Modes

Source: https://www.mikoshi.digital/docs/usage/scan-modes

> Choose the right scan depth for your use case

Mikoshi offers three scan modes to balance speed and thoroughness.

## Quick

```bash
mikoshi --target ./app --scan-mode quick
```

Fast checks for obvious vulnerabilities. Best for:
- CI/CD pipelines
- Pull request validation
- Rapid smoke tests

**Duration**: Minutes

## Standard

```bash
mikoshi --target ./app --scan-mode standard
```

Balanced testing for routine security reviews. Best for:
- Regular security assessments
- Pre-release validation
- Development milestones

**Duration**: 30 minutes to 1 hour

**White-box behavior**: Uses source-aware mapping and static triage to prioritize dynamic exploit validation paths.

## Deep

```bash
mikoshi --target ./app --scan-mode deep
```

Thorough penetration testing. Best for:
- Comprehensive security audits
- Pre-production reviews
- Critical application assessments

**Duration**: 1-4 hours depending on target complexity

**White-box behavior**: Runs broad source-aware triage (`opengrep`, AST structural search, secrets, supply-chain checks) and then systematically validates top candidates dynamically.

<Note>
Deep mode is the default. It explores edge cases, chained vulnerabilities, and complex attack paths.
</Note>

## Choosing a Mode

| Scenario | Recommended Mode |
|----------|------------------|
| Every PR | Quick |
| Weekly scans | Standard |
| Before major release | Deep |
| Bug bounty hunting | Deep |

# Custom Instructions

Source: https://www.mikoshi.digital/docs/usage/instructions

> Guide Mikoshi with custom testing instructions

Use instructions to provide context, credentials, or focus areas for your scan.

## Inline Instructions

```bash
mikoshi --target https://app.com --instruction "Focus on authentication vulnerabilities"
```

## File-Based Instructions

For complex instructions, use a file:

```bash
mikoshi --target https://app.com --instruction-file ./pentest-instructions.md
```

## Common Use Cases

### Authenticated Testing

```bash
mikoshi --target https://app.com \
  --instruction "Login with email: test@example.com, password: TestPass123"
```

### Focused Scope

```bash
mikoshi --target https://api.example.com \
  --instruction "Focus on IDOR vulnerabilities in the /api/users endpoints"
```

### Exclusions

```bash
mikoshi --target https://app.com \
  --instruction "Do not test /admin or /internal endpoints"
```

### API Testing

```bash
mikoshi --target https://api.example.com \
  --instruction "Use API key header: X-API-Key: abc123. Focus on rate limiting bypass."
```

## Instruction File Example

```markdown instructions.md
# Penetration Test Instructions

## Credentials
- Admin: admin@example.com / AdminPass123
- User: user@example.com / UserPass123

## Focus Areas
1. IDOR in user profile endpoints
2. Privilege escalation between roles
3. JWT token manipulation

## Out of Scope
- /health endpoints
- Third-party integrations
```

<Tip>
Be specific. Good instructions help Mikoshi prioritize the most valuable attack paths.
</Tip>

## Reusable methodology

Keep a methodology that you reuse across engagements in a version-controlled instruction file. Good content for the file:

- Coordination rules, for example which identities to test as HIGH and LOW privilege
- Shared artifacts and the format of the evidence you expect
- Completion criteria
- The built-in skills to delegate to, by name, for example `idor`, `broken_function_level_authorization`, `mass_assignment`, and `business_logic`

Every agent in the scan sees the instructions. Agents do not see the full text of a skill unless the skill matches their subtask, so a methodology written as a skill is often not loaded. Use `--skills` to load a skill into the root agent at start, and keep custom skills for specialist knowledge the built-in set does not have. See [Skills](https://www.mikoshi.digital/docs/advanced/skills#skills-or-instructions).

```bash
mikoshi --target https://api.example.com \
  --instruction-file ./methodology.md \
  --skills idor,broken_function_level_authorization,mass_assignment,business_logic
```

## Workspace files

Instructions become part of the prompt. To give Mikoshi a file to work with, such
as a wordlist, an API specification, or notes, use `--workspace-file`. Mikoshi
places the file into the sandbox workspace before the scan starts.

```bash
mikoshi --target https://app.com --workspace-file ./wordlist.txt
```

The file lands at `/workspace/<file name>`. To choose the destination, write
`PATH:DEST`. `DEST` is a path inside `/workspace`.

```bash
mikoshi --target https://app.com \
  --workspace-file ./openapi.yaml:specs/openapi.yaml \
  --workspace-file ./notes.md
```

Repeat the option for every file you want to place. Mikoshi lists the files in the
agent task, so the agent knows where to read them.

Rules that apply to every workspace file:

- Mikoshi copies the file into the sandbox. The agent can edit the copy, but the
  file on your machine does not change.
- The destination must stay inside `/workspace`.
- The destination must not fall inside a target directory, because target files
  come from the target itself. Mikoshi skips such a file and logs a warning.
- Two files cannot claim the same destination.

<Note>
A workspace file is data for the agent to use. It is not a scan target, and its
contents do not change the instructions.
</Note>

<Warning>
Do not place secrets in a workspace file. The sandbox runs untrusted target
code, so treat anything you place there as readable by the target.
</Warning>

# Local Web Viewer

Source: https://www.mikoshi.digital/docs/usage/viewer

> Browse a run in a local dashboard with mikoshi view

Every scan writes its results to disk as it runs. `mikoshi view` serves those files in a local dashboard, for a live run or a finished one.

```bash
mikoshi view                                    # the most recent run
mikoshi view my-run-name                        # a specific run under ./mikoshi_runs
mikoshi view --host 0.0.0.0 --port 8080 --no-open
```

The UI ships prebuilt with Mikoshi, so there is no extra install and no JavaScript build step. The dashboard reads the run files straight off disk. Nothing leaves your machine, and you do not need a cloud account.

## Options

<ParamField path="run" type="string">
  Run name under `./mikoshi_runs`. Defaults to the most recent run.
</ParamField>

<ParamField path="--host" type="string" default="127.0.0.1">
  Host to bind to. Use `0.0.0.0` to reach the viewer from other machines.
</ParamField>

<ParamField path="--port" type="number" default="0">
  Port to serve on. The default selects an available ephemeral port.
</ParamField>

<ParamField path="--no-open" type="boolean">
  Do not open the browser automatically.
</ParamField>

## What Is In The Dashboard

- **Overview** — run status, target, and a severity breakdown of everything found so far.
- **Vulnerabilities** — each validated finding with its severity, details, and reproduction steps.
- **Agent graph** — a live map of the multi-agent team, and what each agent is doing.
- **Steering** — send instructions to a live scan to redirect the agents during the run. Steering works only in the dashboard the running scan opens. A standalone `mikoshi view` has no live scan to steer.
- **History** — browse past runs on this machine and move between them. Verify your email address in the dashboard to unlock the other runs.
- **Reports** — generate a shareable report and send it by email. Verify your email address first.

## Sharing The Link

<Warning>
  The token in the printed URL grants access to the run data, and to the steering of a live scan. Share it only with trusted users.
</Warning>

To reach the viewer from another machine, start it with `--host 0.0.0.0` and replace `0.0.0.0` in the printed URL with a reachable IP address or hostname. Restrict the port with your firewall. A request without the token-derived session cannot read run data.

# Overview

Source: https://www.mikoshi.digital/docs/llm-providers/overview

> Configure your AI model for Mikoshi

Mikoshi uses [LiteLLM](https://docs.litellm.ai/docs/providers) for model compatibility, supporting 100+ LLM providers.

## Configuration

Set your model and API key:

| Model                 | Provider                  | Configuration                    |
| --------------------- | ------------------------- | -------------------------------- |
| GLM-5.3 (recommended) | Vercel AI Gateway         | `vercel_ai_gateway/zai/glm-5.3`  |
| GLM-5.3 (recommended) | OpenRouter                | `openrouter/z-ai/glm-5.3`        |
| GPT-6.1 Sol           | OpenAI                    | `openai/gpt-6.1-sol`             |
| Claude Opus 5.5       | Anthropic                 | `anthropic/claude-opus-5-5`      |
| Claude Sonnet 5.5     | Anthropic                 | `anthropic/claude-sonnet-5-5`    |
| Gemini 4 Argon        | Google Vertex             | `vertex_ai/gemini-4-argon`       |
| DeepSeek V4.1 Flash   | DeepSeek                  | `deepseek/deepseek-flash`        |
| DeepSeek V4 Pro       | DeepSeek                  | `deepseek/deepseek-v4-pro`       |
| Kimi K3.1 Pro         | Moonshot                  | `moonshot/kimi-k3.1-pro`         |

<Note>
Frontier OpenAI, Anthropic and Gemini models need a cyber access program for security testing: [Daybreak](https://openai.com/daybreak/) for OpenAI, the [Cyber Verification Program](https://support.claude.com/en/articles/14604842-cyber-verification-program) for Anthropic, and the [Fairwind Program](https://deepmind.google/fairwind-program/) for Gemini.
</Note>

<CodeGroup>
```bash Vercel AI Gateway
export MIKOSHI_LLM="vercel_ai_gateway/zai/glm-5.3"
export LLM_API_KEY="your-api-key"
```

```bash OpenRouter
export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
export LLM_API_KEY="your-api-key"
```
</CodeGroup>

## Local Models

Run models locally with [Ollama](https://ollama.com), [LM Studio](https://lmstudio.ai), or any OpenAI-compatible server:

```bash
export MIKOSHI_LLM="ollama/llama4"
export LLM_API_BASE="http://localhost:11434"
```

See the [Local Models guide](https://www.mikoshi.digital/docs/llm-providers/local) for setup instructions and recommended models.

## Provider Guides

<CardGroup cols={2}>
  <Card title="OpenAI" href="https://www.mikoshi.digital/docs/llm-providers/openai">
    GPT-5.4 models.
  </Card>
  <Card title="Anthropic" href="https://www.mikoshi.digital/docs/llm-providers/anthropic">
    Claude Opus, Sonnet, and Haiku.
  </Card>
  <Card title="OpenRouter" href="https://www.mikoshi.digital/docs/llm-providers/openrouter">
    Access 100+ models through a single API.
  </Card>
  <Card title="Vercel AI Gateway" href="https://www.mikoshi.digital/docs/llm-providers/vercel-ai-gateway">
    Access 100+ models through one OpenAI-compatible endpoint.
  </Card>
  <Card title="Google Vertex AI" href="https://www.mikoshi.digital/docs/llm-providers/vertex">
    Gemini 3 models via Google Cloud.
  </Card>
  <Card title="AWS Bedrock" href="https://www.mikoshi.digital/docs/llm-providers/bedrock">
    Claude and Titan models via AWS.
  </Card>
  <Card title="Azure OpenAI" href="https://www.mikoshi.digital/docs/llm-providers/azure">
    GPT-5.4 via Azure.
  </Card>
  <Card title="Local Models" href="https://www.mikoshi.digital/docs/llm-providers/local">
    Llama 4, Mistral, and self-hosted models.
  </Card>
</CardGroup>

## Model Format

Use LiteLLM's `provider/model-name` format:

```
openrouter/z-ai/glm-5.3
openai/gpt-6.1-sol
anthropic/claude-sonnet-5-5
vertex_ai/gemini-4-argon
bedrock/us.anthropic.claude-sonnet-5-5
ollama/llama4
```

# OpenAI

Source: https://www.mikoshi.digital/docs/llm-providers/openai

> Configure Mikoshi with OpenAI models

## Setup

```bash
export MIKOSHI_LLM="openai/gpt-6.1-sol"
export LLM_API_KEY="sk-..."
```

## Available Models

| Model | Description |
|-------|-------------|
| `openai/gpt-6.1-sol` | Best balance of capability and cost for agentic security work |
| `openai/gpt-6-astra` | Flagship, maximum capability |
| `openai/gpt-6-luna` | Fast and cheap |

See [OpenAI Models Documentation](https://platform.openai.com/docs/models) for the full list.

<Note>
Security testing with OpenAI models needs [Daybreak](https://openai.com/daybreak/) (Trusted Access for Cyber). Without it the models refuse most offensive tasks. [Request access](https://openai.com/form/enterprise-trusted-access-for-cyber/).
</Note>

## Get API Key

1. Go to [platform.openai.com](https://platform.openai.com)
2. Navigate to API Keys
3. Create a new secret key

## Custom Base URL

For OpenAI-compatible APIs:

```bash
export MIKOSHI_LLM="openai/gpt-6.1-sol"
export LLM_API_KEY="your-key"
export LLM_API_BASE="https://your-proxy.com/v1"
```

# Anthropic

Source: https://www.mikoshi.digital/docs/llm-providers/anthropic

> Configure Mikoshi with Claude models

## Setup

```bash
export MIKOSHI_LLM="anthropic/claude-sonnet-5-5"
export LLM_API_KEY="sk-ant-..."
```

## Available Models

| Model | Description |
|-------|-------------|
| `anthropic/claude-sonnet-5-5` | Best balance of intelligence and speed |
| `anthropic/claude-opus-5-5` | Maximum capability for deep analysis |

<Note>
Security testing with Claude needs the [Cyber Verification Program](https://support.claude.com/en/articles/14604842-cyber-verification-program) (CVP). Without it the safety classifiers block most offensive tasks. Red Team Access covers authorized penetration testing.
</Note>

## Get API Key

1. Go to [console.anthropic.com](https://console.anthropic.com)
2. Navigate to API Keys
3. Create a new key

# Vercel AI Gateway

Source: https://www.mikoshi.digital/docs/llm-providers/vercel-ai-gateway

> Configure Mikoshi with models through Vercel AI Gateway

[Vercel AI Gateway](https://vercel.com/docs/ai-gateway) provides access to 100+ models from multiple providers through one OpenAI-compatible API.

## Setup

Create an [AI Gateway API key](https://vercel.com/docs/ai-gateway/authentication-and-byok), then configure Mikoshi:

```bash
export MIKOSHI_LLM="vercel_ai_gateway/zai/glm-5.3"
export LLM_API_KEY="your-ai-gateway-api-key"
```

The `vercel_ai_gateway/` prefix selects the Gateway. The remaining value is the [AI Gateway model ID](https://vercel.com/docs/ai-gateway/models-and-providers).

## Available Models

Access any model on the Gateway using the format `vercel_ai_gateway/<provider>/<model>`:

| Model | Configuration |
|-------|---------------|
| GLM-5.3 (recommended) | `vercel_ai_gateway/zai/glm-5.3` |
| GPT-6.1 Sol | `vercel_ai_gateway/openai/gpt-6.1-sol` |
| GPT-6 Astra | `vercel_ai_gateway/openai/gpt-6-astra` |
| Claude Opus 5.5 | `vercel_ai_gateway/anthropic/claude-opus-5.5` |
| Claude Sonnet 5.5 | `vercel_ai_gateway/anthropic/claude-sonnet-5.5` |
| Gemini 4 Argon | `vercel_ai_gateway/google/gemini-4-argon` |
| Gemini 3.8 Flash | `vercel_ai_gateway/google/gemini-3.8-flash` |
| DeepSeek V4.1 Flash | `vercel_ai_gateway/deepseek/deepseek-v4.1-flash-1017` |
| DeepSeek V4 Pro | `vercel_ai_gateway/deepseek/deepseek-v4-pro` |
| Kimi K3.1 Pro | `vercel_ai_gateway/moonshotai/kimi-k3.1-pro` |
| GLM-5.3 Flash | `vercel_ai_gateway/zai/glm-5.3-flash` |

OpenAI, Anthropic and Gemini models keep their provider safeguards on the Gateway. Security testing with them needs [Daybreak](https://openai.com/daybreak/), [CVP](https://support.claude.com/en/articles/14604842-cyber-verification-program) or [Fairwind](https://deepmind.google/fairwind-program/) access.

The full list is at the [AI Gateway models page](https://vercel.com/ai-gateway/models) or the models endpoint:

```text
https://ai-gateway.vercel.sh/v1/models
```

## Get API Key

1. Open the [AI Gateway API key settings](https://vercel.com/docs/ai-gateway/authentication-and-byok)
2. Create an API key
3. Set the key as `LLM_API_KEY`

## Benefits

- **Single API** — Access models from OpenAI, Anthropic, Google, Z.ai, and more
- **Bring your own keys** — Route through your own provider accounts when you want
- **Cost tracking** — Monitor Gateway usage and cost in Vercel

# OpenRouter

Source: https://www.mikoshi.digital/docs/llm-providers/openrouter

> Configure Mikoshi with models via OpenRouter

[OpenRouter](https://openrouter.ai) provides access to 100+ models from multiple providers through a single API.

## Setup

```bash
export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
export LLM_API_KEY="sk-or-..."
```

## Available Models

Access any model on OpenRouter using the format `openrouter/<provider>/<model>`:

| Model | Configuration |
|-------|---------------|
| GLM-5.3 (recommended) | `openrouter/z-ai/glm-5.3` |
| GPT-6.1 Sol | `openrouter/openai/gpt-6.1-sol` |
| GPT-6 Astra | `openrouter/openai/gpt-6-astra` |
| Claude Opus 5.5 | `openrouter/anthropic/claude-opus-5.5` |
| Claude Sonnet 5.5 | `openrouter/anthropic/claude-sonnet-5.5` |
| Gemini 4 Argon | `openrouter/google/gemini-4-argon` |
| Gemini 3.8 Flash | `openrouter/google/gemini-3.8-flash` |
| DeepSeek V4.1 Flash | `openrouter/deepseek/deepseek-v4.1-flash-1017` |
| DeepSeek V4 Pro | `openrouter/deepseek/deepseek-v4-pro` |
| Kimi K3.1 Pro | `openrouter/moonshotai/kimi-k3.1-pro` |
| GLM-5.3 Flash | `openrouter/z-ai/glm-5.3-flash` |

OpenAI, Anthropic and Gemini models keep their provider safeguards on OpenRouter. Security testing with them needs [Daybreak](https://openai.com/daybreak/), [CVP](https://support.claude.com/en/articles/14604842-cyber-verification-program) or [Fairwind](https://deepmind.google/fairwind-program/) access.

## Get API Key

1. Go to [openrouter.ai](https://openrouter.ai)
2. Sign in and navigate to Keys
3. Create a new API key

## Benefits

- **Single API** — Access models from OpenAI, Anthropic, Google, Meta, and more
- **Fallback routing** — Automatic failover between providers
- **Cost tracking** — Monitor usage across all models
- **Higher rate limits** — OpenRouter handles provider limits for you

# Google Vertex AI

Source: https://www.mikoshi.digital/docs/llm-providers/vertex

> Configure Mikoshi with Gemini models via Google Cloud

## Setup

```bash
export MIKOSHI_LLM="vertex_ai/gemini-4-argon"
```

No API key required—uses Google Cloud Application Default Credentials.

## Authentication

### Option 1: gcloud CLI

```bash
gcloud auth application-default login
```

### Option 2: Service Account

```bash
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
```

## Available Models

| Model | Description |
|-------|-------------|
| `vertex_ai/gemini-4-argon` | Best overall performance for security testing |
| `vertex_ai/gemini-3.8-flash` | Faster and cheaper |

<Note>
Security testing with Gemini needs the [Fairwind Program](https://deepmind.google/fairwind-program/). Without it the cyber guardrails block most offensive tasks.
</Note>

## Project Configuration

```bash
export VERTEXAI_PROJECT="your-project-id"
export VERTEXAI_LOCATION="global"
```

## Prerequisites

1. Enable the Vertex AI API in your Google Cloud project
2. Ensure your account has the `Vertex AI User` role

# AWS Bedrock

Source: https://www.mikoshi.digital/docs/llm-providers/bedrock

> Configure Mikoshi with models via AWS Bedrock

## Setup

```bash
export MIKOSHI_LLM="bedrock/us.anthropic.claude-sonnet-5-5"
```

No API key required—uses AWS credentials from environment.

## Authentication

### Option 1: AWS CLI Profile

```bash
export AWS_PROFILE="your-profile"
export AWS_REGION="us-east-1"
```

### Option 2: Access Keys

```bash
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"
```

### Option 3: IAM Role (EC2/ECS)

Automatically uses instance role credentials.

## Available Models

| Model | Description |
|-------|-------------|
| `bedrock/us.anthropic.claude-sonnet-5-5` | Claude Sonnet 5.5 |
| `bedrock/us.anthropic.claude-opus-5-5` | Claude Opus 5.5 |
| `bedrock/us.anthropic.claude-haiku-5-5` | Claude Haiku 5.5 |

<Note>
Security testing with Claude needs the [Cyber Verification Program](https://support.claude.com/en/articles/14604842-cyber-verification-program) (CVP), also on Bedrock.
</Note>

## Prerequisites

1. Enable model access in the AWS Bedrock console
2. Ensure your IAM role/user has `bedrock:InvokeModel` permission

# Azure OpenAI

Source: https://www.mikoshi.digital/docs/llm-providers/azure

> Configure Mikoshi with OpenAI models via Azure

## Setup

```bash
export MIKOSHI_LLM="azure/your-gpt6-deployment"
export AZURE_API_KEY="your-azure-api-key"
export AZURE_API_BASE="https://your-resource.openai.azure.com"
export AZURE_API_VERSION="2025-11-01-preview"
```

## Configuration

| Variable | Description |
|----------|-------------|
| `MIKOSHI_LLM` | `azure/<your-deployment-name>` |
| `AZURE_API_KEY` | Your Azure OpenAI API key |
| `AZURE_API_BASE` | Your Azure OpenAI endpoint URL |
| `AZURE_API_VERSION` | API version (e.g., `2025-11-01-preview`) |

## Example

```bash
export MIKOSHI_LLM="azure/gpt-6.1-sol-deployment"
export AZURE_API_KEY="abc123..."
export AZURE_API_BASE="https://mycompany.openai.azure.com"
export AZURE_API_VERSION="2025-11-01-preview"
```

## Prerequisites

1. Create an Azure OpenAI resource
2. Deploy a model such as GPT-6.1 Sol
3. Get the endpoint URL and API key from the Azure portal

<Note>
Security testing with OpenAI models needs [Daybreak](https://openai.com/daybreak/) access, also on Azure.
</Note>

# Novita AI

Source: https://www.mikoshi.digital/docs/llm-providers/novita

> Configure Mikoshi with Novita AI models

[Novita AI](https://novita.ai) provides fast, cost-efficient inference for open-source models via an OpenAI-compatible API.

## Setup

```bash
export MIKOSHI_LLM="openai/zai-org/glm-5.3"
export LLM_API_KEY="your-novita-api-key"
export LLM_API_BASE="https://api.novita.ai/openai"
```

## Available Models

| Model | Configuration |
|-------|---------------|
| GLM-5.3 | `openai/zai-org/glm-5.3` |
| Kimi K3.1 Pro | `openai/moonshotai/kimi-k3.1-pro` |
| Kimi K3 | `openai/moonshotai/kimi-k3` |
| DeepSeek V4.1 Flash | `openai/deepseek/deepseek-v4.1-flash-1017` |
| DeepSeek V4 Pro | `openai/deepseek/deepseek-v4-pro` |
| MiniMax M3.1 Flash | `openai/minimax/minimax-m3.1-flash` |
| GLM-5.3 Flash | `openai/zai-org/glm-5.3-flash` |

## Get API Key

1. Sign up at [novita.ai](https://novita.ai)
2. Navigate to **API Keys** in your dashboard
3. Create a new key and copy it

## Benefits

- **Cost-efficient** — Competitive pricing with per-token billing
- **OpenAI-compatible** — Drop-in replacement using `LLM_API_BASE`
- **Large context** — Models support up to 262k token context windows
- **Function calling** — All listed models support tool/function calling

# Local Models

Source: https://www.mikoshi.digital/docs/llm-providers/local

> Run Mikoshi with self-hosted LLMs for privacy and air-gapped testing

Running Mikoshi with local models allows for completely offline, privacy-first security assessments. Data never leaves your machine, making this ideal for sensitive internal networks or air-gapped environments.

## Privacy vs Performance

| Feature | Local Models | Cloud Models (GPT-5/Claude 4.5) |
|---------|--------------|--------------------------------|
| **Privacy** | 🔒 Data stays local | Data sent to provider |
| **Cost** | Free (hardware only) | Pay-per-token |
| **Reasoning** | Lower (struggles with agents) | State-of-the-art |
| **Setup** | Complex (GPU required) | Instant |

<Warning>
**Compatibility Note**: Mikoshi relies on advanced agentic capabilities (tool use, multi-step planning, self-correction). Most local models, especially those under 70B parameters, struggle with these complex tasks.

For critical assessments, we strongly recommend using state-of-the-art cloud models like **Claude 4.5 Sonnet** or **GPT-5**. Use local models only when privacy is the absolute priority.
</Warning>

## Ollama

[Ollama](https://ollama.ai) is the easiest way to run local models on macOS, Linux, and Windows.

### Setup

1. Install Ollama from [ollama.ai](https://ollama.ai)
2. Pull a high-performance model:
   ```bash
   ollama pull qwen3-vl
   ```
3. Configure Mikoshi:
   ```bash
   export MIKOSHI_LLM="ollama/qwen3-vl"
   export LLM_API_BASE="http://localhost:11434"
   ```

### Recommended Models

We recommend these models for the best balance of reasoning and tool use:

**Recommended models:**
- **Qwen3 VL** (`ollama pull qwen3-vl`)
- **DeepSeek V3.1** (`ollama pull deepseek-v3.1`)
- **Devstral 2** (`ollama pull devstral-2`)

## LM Studio / OpenAI Compatible

If you use LM Studio, vLLM, or other runners:

```bash
export MIKOSHI_LLM="openai/local-model"
export LLM_API_BASE="http://localhost:1234/v1"  # Adjust port as needed
```

### Gateways that require custom headers

Some OpenAI-compatible gateways require extra HTTP headers (for attribution or
tenant routing) alongside the bearer token. Set them with `LLM_EXTRA_HEADERS` as
a JSON object — they are sent on every request:

```bash
export MIKOSHI_LLM="openai/your-model"
export LLM_API_BASE="https://your-gateway.example/v1"
export LLM_API_KEY="your-bearer-token"          # sent as Authorization: Bearer ...
export LLM_EXTRA_HEADERS='{"X-Feature-Key":"value","X-Tenant":"acme"}'
```

### Extra request-body fields

Some provider parameters go in the request body rather than a header, and
Mikoshi has no dedicated setting for them. Set them with `LLM_EXTRA_BODY` as a
JSON object — they are merged into the body of every request to the model. For example, to
use OpenAI's cheaper flex processing and attribute requests to a user with a
safety identifier (a hash, never a raw email):

```bash
export LLM_EXTRA_BODY='{"service_tier":"flex","safety_identifier":"9f86d081884c7d65"}'
```

Fields aren't validated, so use only fields your provider accepts, and don't
set fields Mikoshi already sends, such as `model`, `messages` or `stream`.

For endpoints behind a private CA, point Mikoshi at your certificate bundle with
the standard `SSL_CERT_FILE=/path/to/ca-bundle.pem` — never disable TLS
verification against a real endpoint.

## Tool calling must return structured `tool_calls`

Mikoshi is entirely tool-driven: every working turn must be a **native** function/tool call. If your inference server returns the tool call as plain assistant text instead of a structured `tool_calls` field, Mikoshi never sees a call it can execute, so the agent makes no real progress — it re-prompts the model for a tool call and gives up once its recovery attempts are exhausted.

This is almost always an **inference-server configuration** problem, not a model or Mikoshi problem. Common symptoms are the model printing a call as text such as:

```text
<tool_call>{"name": "exec_command", "arguments": {"cmd": "nmap ..."}}</tool_call>
exec_command(cmd="nmap ...", timeout=180)
{"action": "exec_command", "params": {"cmd": "nmap ..."}}
```

The fix belongs on the inference server: it must be configured to parse the model's tool tokens into structured `tool_calls`. A correctly configured endpoint either returns a structured call or rejects the request outright — it never leaks the call as text.

### Fixes by server

**llama.cpp (`llama-server`)**
- Run with `--jinja` and a correct tool-use chat template (`--chat-template` / `--chat-template-file` matching the model). Recent builds enable `--jinja` by default — **upgrade** if yours doesn't.
- For thinking models, align or disable reasoning (`--reasoning-format`, `-rea off`) so it doesn't break tool-call parsing.
- A low temperature (e.g. `--temp 0.2`) improves tool-call reliability.

**Ollama**
- Use a recent Ollama and a model whose template wires tools. Modern Ollama refuses tools (`tools param requires --jinja flag`) if the template lacks tool support.
- For reasoning models (e.g. qwen3), disable the model's **thinking** mode — thinking left on frequently pushes the tool call into the text `content` instead of the structured `tool_calls` field. Turn it off on the Ollama side (a non-thinking model variant, or `think: false` in the model's parameters / `Modelfile`).
- Raise **`num_ctx`** to at least 16k–32k. Mikoshi sends a large system prompt plus many tool schemas; at Ollama's small default context the tool definitions are truncated out of the prompt and the model stops emitting valid calls. A short test prompt can look fine while a real scan fails, so set this explicitly rather than inferring it from a quick check.

**vLLM**
- Start with `--enable-auto-tool-choice`, a matching `--tool-call-parser` (`hermes`, `qwen3_xml`, or `llama3_json`), and a matching `--reasoning-parser` for reasoning models.

A low sampling temperature (roughly 0.2–0.6, depending on the family) also measurably reduces malformed tool calls on open-weight models. Set it on the server or in your model's parameters.

<Warning>
Even correctly configured, small models (< ~30B) emit malformed or text-form tool calls far more often than frontier models. Prefer a capable model for reliable agentic behavior.
</Warning>

# GitHub Actions

Source: https://www.mikoshi.digital/docs/integrations/github-actions

> Run Mikoshi security scans on every pull request

Integrate Mikoshi into your GitHub workflow to catch vulnerabilities before they reach production.

## Basic Workflow

```yaml .github/workflows/security.yml
name: Security Scan

on:
  pull_request:

jobs:
  mikoshi-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install Mikoshi
        run: curl -sSL https://www.mikoshi.digital/install | bash

      - name: Run Security Scan
        env:
          MIKOSHI_LLM: ${{ secrets.MIKOSHI_LLM }}
          LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
        run: mikoshi -n -t ./ --scan-mode quick
```

## Required Secrets

Add these secrets to your repository:

| Secret | Description |
|--------|-------------|
| `MIKOSHI_LLM` | Model name (e.g., `openrouter/z-ai/glm-5.3`) |
| `LLM_API_KEY` | API key for your LLM provider |

## Exit Codes

The workflow fails when vulnerabilities are found:

| Code | Result |
|------|--------|
| 0 | Pass — No vulnerabilities (with `--fail-on`, none at or above the threshold) |
| 2 | Fail — Vulnerabilities found |

Add `--fail-on high` (or `critical`, `medium`, `low`) to fail only on findings at or above that severity. Lower findings still appear in the report, so a passing run is not necessarily finding-free.

## Scan Modes for CI

| Mode | Duration | Use Case |
|------|----------|----------|
| `quick` | Minutes | Every PR |
| `standard` | ~30 min | Nightly builds |
| `deep` | 1-4 hours | Release candidates |

<Tip>
Use `quick` mode for PRs to keep feedback fast. Schedule `deep` scans nightly.
</Tip>

<Note>
For pull_request workflows, Mikoshi automatically uses changed-files diff-scope in CI/headless runs. If diff resolution fails, ensure full history is fetched (`fetch-depth: 0`) or set `--diff-base`.
</Note>

# CI/CD Integration

Source: https://www.mikoshi.digital/docs/integrations/ci-cd

> Run Mikoshi in any CI/CD pipeline

Mikoshi runs in headless mode for automated pipelines.

## Headless Mode

Use the `-n` or `--non-interactive` flag:

```bash
mikoshi -n --target ./app --scan-mode quick
```

For pull-request style CI runs, Mikoshi automatically scopes quick scans to changed files. You can force this behavior and set a base ref explicitly:

```bash
mikoshi -n --target ./app --scan-mode quick --scope-mode diff --diff-base origin/main
```

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | No vulnerabilities found (with `--fail-on`, none at or above the threshold) |
| 1 | Execution error |
| 2 | Vulnerabilities found (with `--fail-on`, at least one at or above the threshold) |

To fail only on serious findings, pass `--fail-on` with a minimum severity. Lower findings are still reported but exit `0`, so a passing job does not mean the report is empty.:

```bash
mikoshi -n --target ./app --scan-mode quick --fail-on high
```

## Pull-request review comments (GitHub)

With `--pr-comments`, a headless scan posts its findings to the pull request as one GitHub review when it ends:

- Findings whose code location is on a line changed by the PR (an added or context line inside a diff hunk) become **inline comments** on that line.
- Everything else (dynamic/endpoint findings, lines outside the diff, files the PR does not touch) is listed in the **review summary**, with severity counts and the path of each full write-up in the run directory.
- Every finding is counted and listed, including the same issue on several hosts, ports or targets. When two findings would anchor to the same changed line with the same rule, one gets the inline comment and the other is listed in the summary. Text taken from findings (titles, descriptions, paths, ids, severities) is rendered inert: HTML, images, `@mentions` and hidden markers are neutralized.
- Re-runs do not duplicate anything. Each inline comment carries a hidden marker, so findings that already have a comment are skipped. Only markers posted by the token's own account count, so markers typed by anyone else (people or other bots) are ignored; see [Which account Mikoshi posts as](#which-account-mikoshi-posts-as). The summary review is edited in place, and a short follow-up review is posted only when there are new inline findings or changes newly need requesting. A review creation that times out or gets a 5xx is not blindly resent: Mikoshi first re-reads the reviews to check whether GitHub created it.
- The review is a `COMMENT` by default. Add `--pr-request-changes` to submit `REQUEST_CHANGES` when findings meet `--fail-on` (any finding without it). Changes are requested once; later runs with the same findings only update the summary. GitHub does not allow requesting changes on your own PR; Mikoshi falls back to `COMMENT` there. Once a later run has no finding at or above the threshold, Mikoshi dismisses its own earlier `REQUEST_CHANGES` reviews (only reviews posted by the token's account with Mikoshi's summary or follow-up marker; other reviews are never touched). If GitHub refuses the dismissal (for example, branch protection limits who may dismiss reviews), the run does not fail: the summary review says a maintainer must dismiss it manually, a warning is printed, and the review ids are recorded under `pr_comments.dismissal_failed` in `run.json` (`pr_comments.dismissed_reviews` lists successful dismissals).
- If the PR head moved after the scan started (a push during the scan), the review is pinned to the scanned commit and inline comments are placed using that commit's diff, so they land on the lines that were scanned; GitHub shows them as outdated where the newer push changed those lines. If that diff cannot be read, every finding is listed in the summary instead. The summary says which commit was scanned. If the scanned commit is no longer part of the PR at all (the branch was force-pushed during the scan) and GitHub refuses a review on it, the review is attached to the current head instead, every finding is listed in the summary, and the summary and a warning say why.
- Posting never changes the exit code. A failure (missing token or permission, API error, unreadable reply) is printed to stderr and recorded under `pr_comments` in `run.json`. The token is never logged: every printed or recorded message is scrubbed of the token in use and of the values of `GITHUB_TOKEN`, `GH_TOKEN` and the `--token-env` variable.

In GitHub Actions everything is detected from the environment: `GITHUB_TOKEN`, `GITHUB_REPOSITORY`, `GITHUB_EVENT_PATH` (PR number and head commit) and `GITHUB_API_URL` (GitHub Enterprise Server). The job needs `pull-requests: write`:

```yaml .github/workflows/security.yml
name: Security Scan

on:
  pull_request:

permissions:
  contents: read
  pull-requests: write

# One run per PR at a time: two runs racing would each post a summary.
concurrency:
  group: mikoshi-${{ github.event.pull_request.number }}
  cancel-in-progress: true

jobs:
  mikoshi-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install Mikoshi
        run: curl -sSL https://www.mikoshi.digital/install | bash

      - name: Run Security Scan
        env:
          MIKOSHI_LLM: ${{ secrets.MIKOSHI_LLM }}
          LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: mikoshi -n -t ./ --scan-mode quick --fail-on high --pr-comments

      - name: Upload run artifacts
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: mikoshi-report
          path: mikoshi_runs
```

<Note>
On `pull_request` events from forks, `GITHUB_TOKEN` is read-only, so the review cannot be posted (the scan still runs and gates on its exit code). Post from a separate `workflow_run` job with `mikoshi pr-comment` if you need comments on fork PRs.
</Note>

### Which account Mikoshi posts as

Mikoshi reuses its own earlier comments (finding markers, the sticky summary, follow-ups) and dismisses its own requests for changes. To do that safely it must know which account the token posts as; a marker from any other author is never trusted. The account is resolved in this order:

1. `MIKOSHI_PR_BOT_LOGIN`, if set: the exact login as REST shows it on the account's comments, for example `my-app[bot]` or, for an Enterprise Managed User, `jane_acme`. A malformed value fails a real post; a `--dry-run` ignores it with a warning.
2. `GET /user`, for personal access tokens and other user tokens.
3. The GraphQL `viewer`, for installation tokens (GitHub Apps and `GITHUB_TOKEN`), which cannot read `/user` and post as their `<app-slug>[bot]` account. GraphQL names a bot by its bare slug (`github-actions`), so when the viewer is a `Bot` Mikoshi adds the `[bot]` suffix REST uses; a `User` login is taken as is. This read-only query is retried after a timeout or server error like any other read.
4. In GitHub Actions, when the token comes from the `GITHUB_TOKEN` variable: `github-actions[bot]`.

If the account still cannot be determined, Mikoshi trusts no marker at all: it does not skip findings that seem to be commented already, does not edit an earlier summary and never dismisses a review. Each run then posts a fresh review, and a warning (also recorded under `pr_comments.warnings` in `run.json`) names the login GitHub attributed the new review to, so you can set `MIKOSHI_PR_BOT_LOGIN`. If the assumed account turns out to differ from the review's author, the run warns as well. A review is also checked against the posting app when GitHub reports one (`performed_via_github_app`).

### Posting a finished run

`mikoshi pr-comment` posts (or re-posts) any run without scanning again, for example from a later job that downloaded the run directory as an artifact:

```bash
mikoshi pr-comment mikoshi_runs/<run-name>                       # everything from the Actions environment
mikoshi pr-comment <run-name> --repo owner/name --pr 42 --sha <head-sha> --token-env MY_TOKEN
mikoshi pr-comment <run-name> --dry-run --diff-file <(git diff origin/main...HEAD)   # print the review JSON, no network
```

| Option | Meaning |
|--------|---------|
| `--repo OWNER/NAME` | Repository (default `GITHUB_REPOSITORY`) |
| `--pr N` | Pull request number (default: from the event file or `refs/pull/N/...`) |
| `--sha SHA` | Head commit, full or abbreviated (7+ hex digits; default: from the event, else read from the PR). An abbreviation of the PR's current head counts as the head, and the review uses the full SHA |
| `--token-env VAR` | Variable holding the token (default `GITHUB_TOKEN`, then `GH_TOKEN`) |
| `--api-url URL` | API base URL (default `GITHUB_API_URL` or `https://api.github.com`) |
| `--fail-on SEVERITY` / `--request-changes` | Submit `REQUEST_CHANGES` when findings meet the threshold |
| `--dry-run` [`--diff-file PATH`] | Print the review JSON without any network call; the diff decides inline placement |

Exit codes: `0` posted, updated, nothing to post or dry run; `1` error (any failure, recorded under `pr_comments` in `run.json` when the run directory was found); `2` usage.

## GitLab CI

```yaml .gitlab-ci.yml
security-scan:
  image: docker:latest
  services:
    - docker:dind
  variables:
    MIKOSHI_LLM: $MIKOSHI_LLM
    LLM_API_KEY: $LLM_API_KEY
  script:
    - curl -sSL https://www.mikoshi.digital/install | bash
    - mikoshi -n -t ./ --scan-mode quick
```

## Jenkins

```groovy Jenkinsfile
pipeline {
    agent any
    environment {
        MIKOSHI_LLM = credentials('mikoshi-llm')
        LLM_API_KEY = credentials('llm-api-key')
    }
    stages {
        stage('Security Scan') {
            steps {
                sh 'curl -sSL https://www.mikoshi.digital/install | bash'
                sh 'mikoshi -n -t ./ --scan-mode quick'
            }
        }
    }
}
```

## CircleCI

```yaml .circleci/config.yml
version: 2.1
jobs:
  security-scan:
    docker:
      - image: cimg/base:current
    steps:
      - checkout
      - setup_remote_docker
      - run:
          name: Install Mikoshi
          command: curl -sSL https://www.mikoshi.digital/install | bash
      - run:
          name: Run Scan
          command: mikoshi -n -t ./ --scan-mode quick
```

<Note>
All CI platforms require Docker access. Ensure your runner has Docker available.
</Note>

<Tip>
If diff-scope fails in CI, fetch full git history (for example, `fetch-depth: 0` in GitHub Actions) so merge-base and branch comparison can be resolved.
</Tip>

# Coding Agents

Source: https://www.mikoshi.digital/docs/integrations/coding-agents

> Use Mikoshi from Claude Code, Cursor, Codex, and other AI agents

Mikoshi is built to be driven by AI coding agents. Install the official agent skills and your agent knows how to run pentests, remediate findings, and wire Mikoshi into CI.

## Install the Skills

Works with any agent that supports the [SKILL.md standard](https://agentskills.io) — Claude Code, Cursor, Codex, Gemini CLI, OpenCode, and dozens more. Each skill is published on the Mikoshi website at `https://www.mikoshi.digital/skills/<skill-name>/SKILL.md`. Download the ones you want into your agent's skills directory. For Claude Code:

```bash
for skill in penetration-testing-with-mikoshi fix-security-vulnerabilities-with-mikoshi ci-security-scanning-with-mikoshi; do
  mkdir -p ~/.claude/skills/$skill
  curl -fsSL "https://www.mikoshi.digital/skills/$skill/SKILL.md" -o ~/.claude/skills/$skill/SKILL.md
done
```

For other agents, use the same URLs and save each file as `<skills-dir>/<skill-name>/SKILL.md`.

| Skill | What your agent learns |
|-------|------------------------|
| `penetration-testing-with-mikoshi` | Run headless scans against code, URLs, domains, or IPs — self-hosted CLI or managed cloud — with budget caps, and read the results |
| `managed-pentesting-with-mikoshi` | Drive the managed [app.mikoshi.digital](https://app.mikoshi.digital) platform over REST — no local Docker or LLM key needed |
| `fix-security-vulnerabilities-with-mikoshi` | Triage findings, fix root causes, and re-run Mikoshi to verify each fix |
| `ci-security-scanning-with-mikoshi` | Add PR security scanning to GitHub Actions or any CI (self-hosted CLI or managed app) |
| `application-security-testing` | Assess a whole product: choose the right test for each asset, then rank the findings into one remediation plan |
| `web-app-penetration-testing` | Black-box pentest of a live web app or staging site — scope, credentials, and multi-account access-control testing |
| `api-security-testing` | Test a REST/GraphQL API against the OWASP API Security Top 10 — schema-driven enumeration, BOLA/IDOR, authz |
| `owasp-top-10-testing` | Systematic OWASP Top 10 assessment with honest per-category coverage |
| `find-security-vulnerabilities-in-code` | White-box security review of a repo or working tree, with exploits to confirm findings |

To use a skill once without installing it, pipe it into your agent:

```bash
curl -fsSL https://www.mikoshi.digital/skills/penetration-testing-with-mikoshi/SKILL.md | claude
```

## Two ways to run — self-hosted or managed

Both use the same engine and produce the same validated findings and SARIF, so agents can pick per situation or combine them:

- **Mikoshi CLI (self-hosted)** — runs locally in a Docker sandbox with your own LLM key. Free, fully local, air-gap capable. Best for local dev loops and full control.
- **Managed cloud (planned, not live yet)** — will run on Mikoshi's infrastructure. A web app MVP is being built at [mikoshi.digital/app](https://www.mikoshi.digital/app); until it ships, use the Mikoshi CLI. Drive it with the `mikoshi cloud` CLI (every REST operation has a `mikoshi cloud <resource> <verb>` command) or the [app.mikoshi.digital REST API](https://docs.app.mikoshi.digital) directly. No Docker, no LLM key; adds team dashboards, scheduling, PR reviews, and downloadable PDF/DOCX reports (Enterprise plan). Best in sandboxed/CI environments and for teams. Sign in with `mikoshi cloud login` (browser device sign-in, account created on first use) or create a token in the dashboard under **Settings → API Access**. The `managed-pentesting-with-mikoshi` skill has the full flow.

## Agent-Friendly Interfaces

Everything an agent needs is machine-readable:

- **Headless CLI** — `mikoshi -n` runs without the TUI and exits with `0` (clean), `1` (error), or `2` (vulnerabilities found).
- **Cloud CLI** — `mikoshi cloud` prints JSON when stdout is not a terminal (or with `--json`), never prompts without a TTY, and exits with `0` (success), `1` (error), `2` (usage), `4` (authentication required), or `5` (payment required). Credit top-ups pay the Stripe machine-payment challenge with an agent wallet (`mikoshi cloud billing topup --credits N --yes`). Account setup also runs from the CLI: `mikoshi cloud workspaces list|create|use`, `mikoshi cloud org members invite`, `mikoshi cloud billing subscribe`, `mikoshi cloud billing portal`, and `mikoshi cloud integrations install github`. The last three print a hosted link the user opens to finish the payment or approve the installation.
- **REST API** — the managed platform exposes a documented [OpenAPI](https://docs.app.mikoshi.digital/openapi.json) at `https://app.mikoshi.digital/api/v1` (scans, vulnerabilities, assets, PR reviews, schedules, webhooks) with bearer tokens and scopes.
- **Structured results** — every run writes `vulnerabilities.json`, `vulnerabilities.csv`, `findings.sarif` (SARIF 2.1.0), and per-finding Markdown under `mikoshi_runs/<run-name>/`; the cloud exposes the same as JSON plus SARIF export.
- **Budget controls** — `--max-budget` and `--max-turns` give agents hard cost/time caps.
- **`llms.txt`** — this documentation is indexed at [mikoshi.digital/docs/llms.txt](https://www.mikoshi.digital/docs/llms.txt) and fully exported at [mikoshi.digital/docs/llms-full.txt](https://www.mikoshi.digital/docs/llms-full.txt).

## Example Prompts

Once the skills are installed, prompts like these just work:

```text
Pentest this repo with Mikoshi (quick mode, $10 budget) and summarize the findings.
```

```text
Fix all critical and high findings from the last Mikoshi run, then re-scan to verify.
```

```text
Add Mikoshi security scanning to our GitHub Actions so every PR gets tested.
```

# Mikoshi MCP server

Source: https://www.mikoshi.digital/docs/integrations/mcp-server

> Run Mikoshi as a local MCP tool server for Claude Code, Cursor and other MCP clients

`mikoshi mcp` turns Mikoshi into a tool server for an MCP client such as Claude Code or the
Claude desktop app. The client's model runs the test. Mikoshi provides the Docker sandbox,
its testing playbooks, and its reporting. No LLM key is needed: the model usage is the
client's own (for example, a Claude subscription used in Claude's apps).

## Local setup (stdio)

The local stdio server is the supported way to use Mikoshi over MCP. It runs on your
machine, is started by the MCP client, and talks to it over stdin/stdout.

**Requirements**

- The `mikoshi` CLI on your `PATH` (or run it from a source checkout with
  `uv run --project /path/to/Mikoshi mikoshi mcp`).
- Docker running, with access to the sandbox image (the default from Mikoshi's settings;
  override it with `MIKOSHI_IMAGE` or `--image`).
- No LLM key: the MCP client's model drives the test.

Check that the server starts: `mikoshi mcp --help`.

**Claude Code**, from the project you want to test:

```bash
claude mcp add mikoshi -- mikoshi mcp
# Also authorize a live target (repeat --allow-target as needed):
claude mcp add mikoshi -- mikoshi mcp --allow-target staging.example.com
```

Claude Code starts the server in the project directory, so that directory is the
authorized source root and `mikoshi_runs/` is written there. Check it with `claude mcp list`.

**Cursor** (`.cursor/mcp.json` in the project, or `~/.cursor/mcp.json` for all projects):

```json
{
  "mcpServers": {
    "mikoshi": {
      "command": "mikoshi",
      "args": ["mcp",
               "--allow-path", "/path/to/repo",
               "--allow-target", "staging.example.com",
               "--runs-dir", "/path/to/reports"]
    }
  }
}
```

Pass `--allow-path` and `--runs-dir` explicitly for Cursor and other clients that may not
start the server in your project directory. If the working directory is the filesystem
root, no source path is authorized by default and runs go to `~/.mikoshi/mcp`.

**Claude desktop** (`claude_desktop_config.json`) uses the same `mcpServers` block as
Cursor above.

If `mikoshi` is not on the client's `PATH`, use its absolute path (`which mikoshi`) as
`command`. Set `MIKOSHI_MCP_LOG_LEVEL=INFO` (in the client's `env` block) to get server
logs on stderr; stdout carries the protocol.

Then ask the model to "run a quick Mikoshi pentest of staging.example.com", or use the
`pentest` prompt.

## Scope

The model is not trusted to decide what it may attack. `start_engagement` refuses any
target outside the operator's scope, and nothing starts:

| Target | Allowed when |
|---|---|
| Local directory | It is under an `--allow-path` root (default: the working directory). It is mounted read-only. |
| URL, domain, IP | Its host matches `--allow-target` or `MIKOSHI_MCP_ALLOWED_TARGETS` (host, `*.domain`, IP, or CIDR). |
| `localhost`, loopback | Always, unless `--no-loopback`. Inside the sandbox it is `host.docker.internal`. |

`sandbox_exec` also warns when a command names a URL outside scope. That check is advisory:
on your own machine you are the operator. A hosted deployment must enforce egress at the
network level instead.

## Tools

| Tool | Purpose |
|---|---|
| `start_engagement` | Authorize targets, start the sandbox, return the methodology briefing |
| `sandbox_exec` | Run a bash command in the sandbox |
| `engagement_status`, `end_engagement` | Inspect or stop the engagement |
| `list_skills`, `load_skill` | Mikoshi's testing playbooks |
| `create_vulnerability_report` and the other report tools | File and manage findings, with Mikoshi's validation |
| `record_coverage`, `update_coverage`, `list_coverage` | Track what was tested |
| `create_note` and the other note tools | Working notes |
| `finish_scan` | Write the final report and shut the sandbox down |

Output lands in `mikoshi_runs/<run>/` under `--runs-dir`, the same as a CLI scan:
`penetration_test_report.md`, `vulnerabilities.json`, `findings.sarif`, `run.json`.

## Limits

- One engagement per server process (Mikoshi's report state is process-wide).
- The HTTP proxy (Caido) is not started; use curl, the browser, or scripts in the sandbox.
- Repository URLs are not accepted yet; clone locally and pass the directory.
- There is no dollar budget: usage counts against the client's own plan limits.

## Hosted service (`mikoshi mcp serve`): not yet available

> **Not yet available.** The hosted, multi-tenant service and its Kubernetes deployment
> (`deploy/k8s/`, `containers/mcp/`) are deferred. The code is kept for future work but is
> not supported or deployed, and nothing in the local server, the CLI, or the tests needs
> a cluster. The rest of this section describes the intended design.

The same engine, served over Streamable HTTP to many customers. Customers add the
service to their LLM app (in Claude: Settings → Connectors → Add custom connector,
URL `https://<your-host>/mcp`) and sign in through your identity provider.

```
MCP client --HTTPS + OAuth--> gateway --> one worker per engagement --Docker--> sandbox
                                          (local process over stdio, or a Kubernetes
                                           pod over HTTP with a per-engagement token)
```

```bash
# Keep this stable: it signs the domain challenges.
export MIKOSHI_MCP_SECRET="$(openssl rand -hex 32)"
# --issuer takes any OIDC provider (Auth0, Clerk, WorkOS, Cognito, Keycloak, ...).
mikoshi mcp serve \
  --public-url https://mcp.example.com \
  --issuer https://<tenant>.auth0.com/ \
  --required-scope mikoshi \
  --data-dir /var/lib/mikoshi \
  --host 0.0.0.0 --port 8765 --egress-enforced
```

For local development, skip the identity provider with fixed tokens:
`MIKOSHI_MCP_STATIC_TOKENS="<24+ char token>:<tenant>"` and the default `--host 127.0.0.1`.

### What the gateway enforces

| Control | How |
|---|---|
| Authentication | OAuth 2.1 resource server: JWT access tokens checked against the provider's JWKS (issuer, audience, expiry, scopes). Clients discover the provider at `/.well-known/oauth-protected-resource/mcp`. |
| Tenancy | The token subject is the tenant. Verified domains, engagements and reports are scoped to it. |
| Domain ownership | `verify_domain` gives a DNS TXT record (`_mikoshi-challenge.<domain>`, covers subdomains) or a `/.well-known/mikoshi-verification.txt` file (that host only). The token is an HMAC of tenant and domain, so it cannot be reused across accounts. |
| Target scope | `start_engagement` accepts only domains and URLs covered by the tenant's verified domains. No IPs, local paths, or loopback. Targets must resolve to public addresses (blocks cloud metadata and internal ranges). |
| Isolation | Each engagement runs in its own worker process with exactly the verified hosts as scope, and its own report directory. Workers get no gateway secrets. |
| Limits | One engagement per tenant, `--max-engagements` overall, ended after `--idle-timeout-min` idle or `--max-engagement-hours`. |
| Reports | `list_engagements` and `download_report` (report with findings, JSON, SARIF, run record), path-checked to the tenant's directory. |

### Network egress control

The sandbox user has root (sudo) and `NET_ADMIN`, so firewall rules inside the
container do not hold. Egress is enforced **outside** the sandbox:

- **Kubernetes (`--launcher kubernetes`, recommended).** Each engagement runs in its
  own pod (worker plus a Docker-in-Docker sidecar that hosts the sandbox), created only
  after a per-engagement `NetworkPolicy` that allows the targets' resolved public
  addresses, cluster DNS, and the in-cluster image registry, and nothing else. All
  sandbox traffic leaves through the pod, so the policy holds whatever the tester does
  inside it. With Cilium, a `CiliumNetworkPolicy` also allows the verified names
  (`toFQDNs`). See [`deploy/k8s/README.md`](../deploy/k8s/README.md).
- **Single host (`--launcher subprocess`).** Workers are local processes and sandboxes
  share the host's network. Restrict them with host firewall rules (`DOCKER-USER`)
  yourself; `mikoshi mcp serve` refuses to listen on a non-loopback address until you
  pass `--egress-enforced` to confirm it.

The target checks stop the model from being *asked* to attack someone else's host;
egress control stops a sandbox from *reaching* one.

### Also needed in production

- The service image (`containers/mcp/Dockerfile`) and the sandbox image
  (`containers/Dockerfile`) published where the cluster can pull them.
- TLS termination in front of the gateway, and persistent storage for `--data-dir`.
- An identity provider; [`deploy/k8s/README.md`](../deploy/k8s/README.md) walks
  through Auth0.
- Customer terms covering authorized testing (the website's acceptable-use page).

# MCP Servers

Source: https://www.mikoshi.digital/docs/integrations/mcp

> Connect your own MCP servers and expose their tools to the agent

Mikoshi can connect to [Model Context Protocol (MCP)](https://modelcontextprotocol.io) servers you list and expose their tools to the agent during a run. Use this to let the agent read how your system is actually built instead of inferring it from the outside.

A few things it pays off for:

- **A database server.** The agent can read the schema and access policies and see tables left readable without them, rather than guessing from responses.
- **A hosting or infrastructure server.** Deployments, domains and environment variable names tell it what is really running, so it tests what exists instead of what it discovered by crawling.
- **An issue tracker.** Known and accepted risks stop the agent re-reporting findings you already triaged.
- **A logging server.** Reading logs lets it confirm an exploit attempt actually landed instead of inferring it from a status code.

## Setup

Create the file `~/.mikoshi/mcp-servers.json`. It holds a JSON list of the servers you want the agent to reach. Each entry is either a local `stdio` server that Mikoshi launches as a subprocess, or a remote `http` server.

Create the directory if it does not exist, then write the file:

```bash
mkdir -p ~/.mikoshi
```

Paste the servers you want into `~/.mikoshi/mcp-servers.json`. The example below shows one of each transport: a local filesystem server over `stdio` and a remote GitHub server over `http` with a bearer token:

```json
[
  {
    "name": "local_fs",
    "transport": "stdio",
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
  },
  {
    "name": "github",
    "transport": "http",
    "url": "https://api.githubcopilot.com/mcp/",
    "auth": { "kind": "bearer", "token": "your-token" },
    "allowed_tools": ["list_issues"]
  }
]
```

Mikoshi reads this file at the start of each run. There is no default file, so no MCP tools are loaded until you create it. Edit `command`, `args`, `url`, and `token` to match your own servers.

## Fields

<ParamField path="name" type="string" required>
  A short label for the connection. Each server's tools are namespaced by
  `name` (for example `local_fs_read_file`), so two servers can offer the same
  tool name without colliding.
</ParamField>

<ParamField path="transport" type="string">
  `stdio` for a local subprocess server, or `http` for a remote server.
</ParamField>

<ParamField path="command" type="string">
  For `stdio` servers: the executable Mikoshi launches (for example `npx`).
</ParamField>

<ParamField path="args" type="array">
  For `stdio` servers: the arguments passed to `command`.
</ParamField>

<ParamField path="url" type="string">
  For `http` servers: the server endpoint URL.
</ParamField>

<ParamField path="auth" type="object">
  For `http` servers that need a bearer token:
  `{ "kind": "bearer", "token": "your-token" }`.
</ParamField>

<ParamField path="allowed_tools" type="array">
  Restrict which tools the agent can call. Omit it to expose every tool the
  server offers, or set it to a list of tool names to allow only those. Mikoshi
  does not decide for you which of a server's tools only read and which change
  things, so run the server in its own read-only mode if it has one.
</ParamField>

<ParamField path="notes" type="string">
  Free-text notes for the agent about what this connection is and how you want
  it used, for example "Staging analytics database, read-only, prefer aggregate
  queries." When set, the notes are given to the agent at the start of the run
  as a description of the connection.
</ParamField>

## Choosing connections per run

By default every connection in the file is used on each run. To narrow it for a
single run without editing the file, use either flag (both repeatable):

```bash
mikoshi --mcp-server github -t ...        # use only the named connection(s)
mikoshi --mcp-exclude staging-db -t ...   # use everything except the named one(s)
```

`--mcp-server` keeps only the connections you name; `--mcp-exclude` drops the
ones you name. Connection names must be unique in the file; if two entries share
a name, the first is kept and the rest are ignored.

## Pointing at a different file

To read the config from another path instead of `~/.mikoshi/mcp-servers.json`, either pass `--mcp-config <path>` on the command line:

```bash
mikoshi --mcp-config ./mcp-servers.json -t ...
```

or set the `MIKOSHI_MCP_CONFIG` environment variable to that path. The flag takes precedence when both are given.

## Startup confirmation

When servers are configured, Mikoshi prints a one-line summary at scan startup, for example `MCP: connected 1 server (14 tools): local_fs`, so you can confirm your servers connected.

## Seeing the calls

Each call the agent makes to one of your servers is shown with its own icon and
labelled with the connection it went out to, in the terminal and in the run
viewer (`mikoshi view`), so a call that left Mikoshi for a server you connected is
easy to pick out of a transcript. The terminal shows the call and its arguments;
results can be large and arbitrary, so read them in the viewer, which shows a
preview you can expand.

## Behavior

- The config file is optional. Without it, a run simply gets no MCP tools.
- A server that fails to connect is skipped and logged, and the run continues without it.
- A single malformed entry is skipped without blocking the valid ones.

# Agent Tools

Source: https://www.mikoshi.digital/docs/tools/overview

> How Mikoshi agents interact with targets

Mikoshi agents use specialized tools to test your applications like a real penetration tester would.

## Core Tools

<CardGroup cols={2}>
  <Card title="Browser" icon="globe" href="https://www.mikoshi.digital/docs/tools/browser">
    Playwright-powered Chrome for interacting with web UIs.
  </Card>
  <Card title="HTTP Proxy" icon="network-wired" href="https://www.mikoshi.digital/docs/tools/proxy">
    Intercepting proxy (mitmproxy by default) for capturing and replaying requests.
  </Card>
  <Card title="Terminal" icon="terminal" href="https://www.mikoshi.digital/docs/tools/terminal">
    Bash shell for running commands and security tools.
  </Card>
  <Card title="Sandbox Tools" icon="toolbox" href="https://www.mikoshi.digital/docs/tools/sandbox">
    Pre-installed security tools: Nuclei, ffuf, and more.
  </Card>
</CardGroup>

## Additional Tools

| Tool           | Purpose                                  |
| -------------- | ---------------------------------------- |
| Python Runtime | Write and execute custom exploit scripts |
| File Editor    | Read and modify source code              |
| Web Search     | Real-time OSINT with Exa or Perplexity   |
| Notes          | Document findings during the scan        |
| Reporting      | Generate vulnerability reports with PoCs |

# Browser

Source: https://www.mikoshi.digital/docs/tools/browser

> Playwright-powered Chrome for web application testing

Mikoshi uses a headless Chrome browser via Playwright to interact with web applications exactly like a real user would.

## How It Works

All browser traffic is automatically routed through the intercepting proxy (mitmproxy by default), giving Mikoshi full visibility into every request and response. This enables:

- Testing client-side vulnerabilities (XSS, DOM manipulation)
- Navigating authenticated flows (login, OAuth, MFA)
- Triggering JavaScript-heavy functionality
- Capturing dynamically generated requests

## Capabilities

| Action     | Description                                 |
| ---------- | ------------------------------------------- |
| Navigate   | Go to URLs, follow links, handle redirects  |
| Click      | Interact with buttons, links, form elements |
| Type       | Fill in forms, search boxes, input fields   |
| Execute JS | Run custom JavaScript in the page context   |
| Screenshot | Capture visual state for reports            |
| Multi-tab  | Test across multiple browser tabs           |

## Example Flow

1. Agent launches browser and navigates to login page
2. Fills in credentials and submits form
3. Proxy captures the authentication request
4. Agent navigates to protected areas
5. Tests for IDOR by replaying requests with modified IDs

# HTTP Proxy

Source: https://www.mikoshi.digital/docs/tools/proxy

> Intercepting proxy for request capture, querying and replay (mitmproxy by default)

Every HTTP(S) client in the sandbox (curl, Python, the browser, scanners) is routed through an intercepting proxy, giving the agent full visibility into requests and responses. The proxy sits behind a pluggable `ProxyBackend` interface:

| Backend | License | Selected with | Notes |
| ------- | ------- | ------------- | ----- |
| **mitmproxy** (default) | MIT | nothing to set | `mitmdump` runs inside the sandbox with a Mikoshi recorder addon. |
| Caido (optional) | Proprietary, bring-your-own | `MIKOSHI_PROXY_BACKEND=caido` | Needs `uv sync --extra caido`, your own Caido entitlement, and a sandbox image built with `--build-arg INSTALL_CAIDO=1`. |

The backend can also be set as `MIKOSHI_PROXY_BACKEND` in the Mikoshi JSON config. Requesting `caido` without the extra installed, or on a sandbox image without `caido-cli`, fails at scan start with an explanation; an unknown name is rejected.

## Capabilities

| Feature          | Description                                  |
| ---------------- | -------------------------------------------- |
| Request Capture  | Log all HTTP/HTTPS traffic automatically     |
| Request Replay   | Repeat any request with modifications        |
| HTTPQL           | Query captured traffic with filters          |
| Scope Management | Focus on specific hosts                      |
| Sitemap          | Browse the discovered attack surface as a tree |

## How the mitmproxy backend works

- The sandbox entrypoint starts `mitmdump` on `127.0.0.1:48080` with `/opt/mikoshi-python/mitm_addon.py`. The addon writes each finished flow (request and response, or the connection error) to a SQLite store in `/tmp/mikoshi-proxy/`. Intercepted TLS uses the image's own CA, which the system store and the browser already trust; upstream certificates are not verified (`ssl_insecure`), as pentest targets often use self-signed certificates.
- The host never needs mitmproxy. Each proxy tool call runs `python3 /opt/mikoshi-python/proxy_api.py <op> <json>` through the sandbox exec channel and reads one JSON reply. No proxy port is exposed to the host.
- `repeat_request` sends the modified raw request from inside the sandbox, through the proxy, so the replay is recorded too (`source:"replay"`) and its id is returned as `request_id` for use as evidence.
- If the proxy does not come up, a pass-through proxy takes over the port so the sandbox keeps its network; the proxy tools then report that the proxy is unavailable.
- With an upstream proxy configured for the scan (`host:port`, `[IPv6]:port`, optionally with `http://`), mitmproxy runs in `upstream` mode and forwards everything to it, and the pass-through relays only to it. The upstream is checked before the sandbox starts: a malformed value, credentials in it, another scheme, the Caido backend or a disabled proxy stop the scan instead of letting traffic bypass the upstream.
- Bodies over 2 MiB are stored cut short. `list_requests` and `view_request` mark such a request or response with `body_truncated_at_capture`, and `repeat_request` refuses to replay a truncated request body unless `modifications.body` supplies the full one.

## HTTPQL Filtering

`list_requests` takes an HTTPQL filter, with the same syntax on both backends: `namespace.field.operator:value` clauses joined with `AND` / `OR` and parentheses, for example `req.method.eq:"POST" AND resp.code.gte:400`. Fields are `req.method|host|path|query|ext|raw|port|len|created_at|tls`, `resp.code|len|roundtrip|raw` and `row.id`; `source:"intercept"|"replay"` and bare quoted strings (searching raw requests and responses) are supported. Caido presets (`preset:"..."`) are Caido-only.

## Request Replay

The agent can take any captured request and replay it with modifications:

- Change path parameters (test for IDOR)
- Modify request body (test for injection)
- Add/remove headers (test for auth bypass)
- Alter cookies (test for session issues)

## Python Integration

Proxy helpers are available to sandbox Python scripts through the image-baked `proxy_api` module (standard library only, synchronous, plain dicts):

```python
from proxy_api import list_requests, repeat_request, view_request

posts = list_requests(httpql_filter='req.method.eq:"POST"', first=20)
first_id = posts["entries"][0]["request"]["id"]
print(view_request(first_id, part="request")["content"])

result = repeat_request(first_id, modifications={"body": '{"user_id": "admin"}'})
print(result["status"], result["response"]["status_code"], result["request_id"])
```

### Available Functions

| Function               | Description                                |
| ---------------------- | ------------------------------------------ |
| `list_requests()`      | Query captured traffic with HTTPQL filters |
| `view_request()`       | Get the raw request or response            |
| `repeat_request()`     | Replay a request with modifications        |
| `list_sitemap()`       | Browse the request-tree view of discovered surface |
| `view_sitemap_entry()` | Inspect one sitemap entry + its related requests |
| `scope_rules()`        | Manage proxy scope (allowlist/denylist)    |

With the Caido backend the module is `caido_api` instead, with async helpers over the Caido SDK.

For one-off arbitrary requests, use shell tooling like `curl` — the sandbox's `HTTP_PROXY` env routes the traffic through the proxy automatically, so it lands in `list_requests` and can be replayed via `repeat_request`.

### Example: Automated IDOR Testing

```python
from proxy_api import list_requests, repeat_request

for entry in list_requests(httpql_filter='req.path.cont:"/users/"')["entries"]:
    req = entry["request"]
    scheme = "https" if req["is_tls"] else "http"
    for test_id in ["1", "2", "admin"]:
        url = f"{scheme}://{req['host']}:{req['port']}{req['path'].replace('/users/1', f'/users/{test_id}')}"
        result = repeat_request(req["id"], modifications={"url": url})
        print(req["id"], test_id, result["status"], (result["response"] or {}).get("status_code"))
```

## Human-in-the-Loop (Caido backend)

With the Caido backend, Caido's port is exposed to the host, so you can open the instance in Caido Desktop ("Continue as guest") to inspect and replay traffic alongside the scan. The default mitmproxy backend exposes no port; inspect its history through the proxy tools or `proxy_api` inside the sandbox.

## Scope

Create scopes (glob patterns over the host) to filter traffic to relevant domains. An empty allowlist allows every host; the denylist always wins:

```
Allowlist: ["api.example.com", "*.example.com"]
Denylist: ["cdn.*", "*.googleapis.com"]
```

# Terminal

Source: https://www.mikoshi.digital/docs/tools/terminal

> Bash shell for running commands and security tools

Mikoshi has access to a persistent bash terminal running inside the Docker sandbox. This gives the agent access to all [pre-installed security tools](https://www.mikoshi.digital/docs/tools/sandbox).

## Capabilities

| Feature           | Description                                                |
| ----------------- | ---------------------------------------------------------- |
| Persistent state  | Working directory and environment persist between commands |
| Multiple sessions | Run parallel terminals for concurrent operations           |
| Background jobs   | Start long-running processes without blocking              |
| Interactive       | Respond to prompts and control running processes           |

## Common Uses

### Running Security Tools

```bash
# Subdomain enumeration
subfinder -d example.com

# Vulnerability scanning
nuclei -u https://example.com

# SQL injection testing
sqlmap -u "https://example.com/page?id=1"
```

### Code Analysis

```bash
# Fast SAST triage
opengrep scan --config /opt/opengrep-rules ./src

# Structural AST search
sg scan ./src

# Secret detection
gitleaks detect --source ./
trufflehog filesystem ./

# Supply-chain and misconfiguration checks
trivy fs ./
```

### Custom Scripts

```bash
# Run Python exploits
python3 exploit.py

# Execute shell scripts
./test_auth_bypass.sh
```

## Session Management

The agent can run multiple terminal sessions concurrently, for example:

- Main session for primary testing
- Secondary session for monitoring
- Background processes for servers or watchers

# Sandbox Tools

Source: https://www.mikoshi.digital/docs/tools/sandbox

> Pre-installed security tools in the Mikoshi container

Mikoshi runs inside a Kali Linux-based Docker container with a comprehensive set of security tools pre-installed. The agent can use any of these tools through the [terminal](https://www.mikoshi.digital/docs/tools/terminal).

## Reconnaissance

| Tool                                                       | Description                            |
| ---------------------------------------------------------- | -------------------------------------- |
| [Subfinder](https://github.com/projectdiscovery/subfinder) | Subdomain discovery                    |
| [Naabu](https://github.com/projectdiscovery/naabu)         | Fast port scanner                      |
| [httpx](https://github.com/projectdiscovery/httpx)         | HTTP probing and analysis              |
| [Katana](https://github.com/projectdiscovery/katana)       | Web crawling and spidering             |
| [ffuf](https://github.com/ffuf/ffuf)                       | Fast web fuzzer                        |
| [Nmap](https://nmap.org)                                   | Network scanning and service detection |

## Web Testing

| Tool                                                   | Description                      |
| ------------------------------------------------------ | -------------------------------- |
| [Arjun](https://github.com/s0md3v/Arjun)               | HTTP parameter discovery         |
| [Dirsearch](https://github.com/maurosoria/dirsearch)   | Directory and file brute-forcing |
| [wafw00f](https://github.com/EnableSecurity/wafw00f)   | WAF fingerprinting               |
| [GoSpider](https://github.com/jaeles-project/gospider) | Web spider for link extraction   |

## Automated Scanners

| Tool                                                 | Description                                        |
| ---------------------------------------------------- | -------------------------------------------------- |
| [Nuclei](https://github.com/projectdiscovery/nuclei) | Template-based vulnerability scanner               |
| [SQLMap](https://sqlmap.org)                         | Automatic SQL injection detection and exploitation |
| [Wapiti](https://wapiti-scanner.github.io)           | Web application vulnerability scanner              |
| [ZAP](https://zaproxy.org)                           | OWASP Zed Attack Proxy                             |

## JavaScript Analysis

| Tool                                                     | Description                    |
| -------------------------------------------------------- | ------------------------------ |
| [JS-Snooper](https://github.com/aravind0x7/JS-Snooper)   | JavaScript reconnaissance      |
| [jsniper](https://github.com/xchopath/jsniper.sh)        | JavaScript file analysis       |
| [Retire.js](https://retirejs.github.io/retire.js)        | Detect vulnerable JS libraries |
| [ESLint](https://eslint.org)                             | JavaScript static analysis     |
| [js-beautify](https://github.com/beautifier/js-beautify) | JavaScript deobfuscation       |
| [JSHint](https://jshint.com)                             | JavaScript code quality tool   |

## Source-Aware Analysis

| Tool                                                    | Description                                   |
| ------------------------------------------------------- | --------------------------------------------- |
| [Opengrep](https://github.com/opengrep/opengrep)        | Fast SAST and custom rule matching            |
| [ast-grep](https://ast-grep.github.io)                 | Structural AST/CST-aware code search (`sg`)   |
| [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) | Syntax tree parsing and symbol extraction (Java/JS/TS/Python/Go/Bash/JSON/YAML grammars pre-configured) |
| [Bandit](https://bandit.readthedocs.io)                | Python security linter                        |

## Secret Detection

| Tool                                                        | Description                           |
| ----------------------------------------------------------- | ------------------------------------- |
| [TruffleHog](https://github.com/trufflesecurity/trufflehog) | Find secrets in code and history      |
| [Gitleaks](https://github.com/gitleaks/gitleaks)            | Detect hardcoded secrets in repositories |

## Authentication Testing

| Tool                                                         | Description                        |
| ------------------------------------------------------------ | ---------------------------------- |
| [jwt_tool](https://github.com/ticarpi/jwt_tool)              | JWT token testing and exploitation |
| [Interactsh](https://github.com/projectdiscovery/interactsh) | Out-of-band interaction detection  |

## Container & Supply Chain

| Tool                       | Description                                    |
| -------------------------- | ---------------------------------------------- |
| [Trivy](https://trivy.dev) | Filesystem/container scanning for vulns, misconfigurations, secrets, and licenses |

## HTTP Proxy

| Tool                      | Description                                   |
| ------------------------- | --------------------------------------------- |
| [mitmproxy](https://mitmproxy.org) | Intercepting HTTP(S) proxy for capture and replay (Caido optional, bring-your-own) |

## Browser

| Tool                                 | Description                 |
| ------------------------------------ | --------------------------- |
| [Playwright](https://playwright.dev) | Headless browser automation |

<Note>
  All tools are pre-configured and ready to use. The agent selects the appropriate tool based on the vulnerability being tested.
</Note>

# Configuration

Source: https://www.mikoshi.digital/docs/advanced/configuration

> Environment variables for Mikoshi

Configure Mikoshi using environment variables or a config file.

## LLM Configuration

<ParamField path="MIKOSHI_LLM" type="string" required>
  Model name in LiteLLM format (e.g., `openrouter/z-ai/glm-5.3`, `openai/gpt-6.1-sol`).
</ParamField>

<ParamField path="MIKOSHI_EFFORT_LLMS" type="string">
  Optional comma-separated list of sub-agent models, ordered from lowest to
  highest effort (e.g. `openrouter/<small-model>,openrouter/<large-model>`).
  A JSON array is also accepted.

  When set, an agent gives every sub-agent it spawns an effort from `1` to the
  length of the list, and that sub-agent runs on the model at that position.
  This is the same for the root agent and for a sub-agent that spawns its own:
  each picks the effort for the task it hands off, so a sub-agent can run on a
  higher or a lower model than the agent that spawned it. Agents see only the
  scale, never the model names. In the live TUI, select an agent to see its model
  in the sidebar, or on the status line when the sidebar is hidden. A routed
  sub-agent's model shows its effort level, e.g. `effort 2/3` for the second
  of three configured levels. With `-n`, the progress panel lists the root model
  and all configured sub-agent models in effort order.

  `MIKOSHI_LLM` is still required and always runs the root agent, which plans the
  scan and coordinates the others. To make it one of the levels, include it in
  the list.

  With a single model in the list, every sub-agent runs on it and no agent is
  asked for an effort. Use this to run the root agent on one model and
  all sub-agents on another, e.g. `MIKOSHI_LLM=openrouter/<large-model>` with
  `MIKOSHI_EFFORT_LLMS=openrouter/<small-model>`.

  Every model in the list uses the same connection as `MIKOSHI_LLM`: `LLM_API_KEY`,
  `LLM_API_BASE`, `LLM_EXTRA_HEADERS` and `LLM_EXTRA_BODY`. Each must be on the
  same provider as `MIKOSHI_LLM` (for example two `openrouter/` models), or behind
  the same `LLM_API_BASE`; the scan stops otherwise.

  The `MIKOSHI_LLM_*_COST_PER_MTOK` overrides do not apply to these models. If
  LiteLLM can't price one and the provider reports no cost, its usage counts as
  `$0` against `--max-budget`.
</ParamField>

<ParamField path="LLM_API_KEY" type="string">
  API key for your LLM provider. Not required for local models or cloud provider auth (Vertex AI, AWS Bedrock).
</ParamField>

<ParamField path="LLM_API_BASE" type="string">
  Custom API base URL. Also accepts `OPENAI_API_BASE`, `LITELLM_BASE_URL`, or `OLLAMA_API_BASE`.
</ParamField>

<ParamField path="MIKOSHI_LLM_INPUT_COST_PER_MTOK" type="number">
  Price per 1M input tokens in USD for `MIKOSHI_LLM`. Use it for gateway or self-hosted model ids that LiteLLM can't price.
</ParamField>

<ParamField path="MIKOSHI_LLM_OUTPUT_COST_PER_MTOK" type="number">
  Price per 1M output tokens in USD for `MIKOSHI_LLM`.
</ParamField>

<ParamField path="MIKOSHI_LLM_CACHED_INPUT_COST_PER_MTOK" type="number">
  Price per 1M cached input tokens in USD for `MIKOSHI_LLM`. If unset, cached tokens use the input price.
</ParamField>

<Note>
  Setting any of these prices replaces the provider-reported and LiteLLM cost for `MIKOSHI_LLM` in reports and `--max-budget`. An unset input or output price counts as `0`, so set both. A separate `MIKOSHI_DEDUPE_MODEL` keeps its LiteLLM price.
</Note>

<ParamField path="MIKOSHI_API_TYPE" type="string">
  Select the OpenAI API path for the model: `responses` or `chat_completions`.
  By default the model decides: Responses when LiteLLM's model catalog lists
  `/v1/responses` for it (e.g. `gpt-5`), chat completions otherwise. A custom
  `LLM_API_BASE` does not change this, so set `MIKOSHI_API_TYPE=chat_completions`
  when your gateway only serves chat completions. Applies to bare and `openai/`
  model names. Also accepts `MIKOSHI_FORCE_API`.
</ParamField>

<ParamField path="LLM_EXTRA_HEADERS" type="string">
  Extra HTTP headers sent on every LLM request, as a JSON object (e.g.
  `{"X-Feature-Key":"value","X-Tenant":"acme"}`). Useful for OpenAI-compatible
  gateways that require attribution or routing headers in addition to the bearer
  token. The bearer token itself still comes from `LLM_API_KEY`. Applies to both
  the LiteLLM and native OpenAI routing paths.
</ParamField>

<ParamField path="LLM_EXTRA_BODY" type="string">
  Extra fields merged into the JSON body of every request to the main model, as a JSON object
  (e.g. `{"service_tier":"flex","safety_identifier":"9f86d081..."}`). Use it
  for provider parameters Mikoshi doesn't expose, such as OpenAI's `service_tier`
  or `safety_identifier`. Applies to both the LiteLLM and native OpenAI routing
  paths. Fields are not validated, so the provider or gateway must accept them;
  unknown fields are usually rejected. Extra fields can override fields Mikoshi
  sends and break requests, so don't set request-shaping fields such as `model`, `messages`, `input`,
  `tools` or `stream`, and use `MIKOSHI_REASONING_EFFORT` rather than
  `reasoning_effort`.
</ParamField>

<ParamField path="LLM_TIMEOUT" default="300" type="integer">
  Request timeout in seconds for LLM calls.
</ParamField>

<ParamField path="LLM_PREFLIGHT_TIMEOUT" default="30" type="integer">
  Seconds the startup connection check waits for the model to answer before
  failing with `LLM CONNECTION FAILED`. Scan requests use `LLM_TIMEOUT`.
</ParamField>

<ParamField path="MIKOSHI_LLM_MAX_RETRIES" default="5" type="integer">
  Maximum number of retries for LLM API calls on transient failures.
</ParamField>

<ParamField path="MIKOSHI_REASONING_EFFORT" default="high" type="string">
  Control thinking effort for reasoning models. Valid values: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Defaults to `medium` for quick scan mode.
</ParamField>

<ParamField path="MIKOSHI_MEMORY_COMPRESSOR_TIMEOUT" default="30" type="integer">
  Timeout in seconds for memory compression operations (context summarization).
</ParamField>

<ParamField path="MIKOSHI_OPENROUTER_STICKY_SESSIONS" default="false" type="boolean">
  Send a per-agent `session_id` on OpenRouter requests, so each agent's calls stay on one upstream provider and its prompt cache carries over between turns. When unset, OpenRouter routes every request freely.
</ParamField>

<ParamField path="MIKOSHI_PAUSE_ON_PROVIDER_QUOTA" default="false" type="boolean">
  Pause the scan when the LLM provider reports that the account has no quota or credits left, instead of letting the scan fail. All agents wait, and findings and agent progress are kept. After you restore the quota, send a message in the TUI to continue. For a headless run (`-n`), stop it and continue it with `mikoshi -n --resume <run-name>`. A paused headless run waits until you stop it, so set a job timeout in CI. Rate limits are retried as usual, and an invalid API key still fails the scan.
</ParamField>

<ParamField path="MIKOSHI_CACHE_BLOCK_TOKENS" default="128" type="integer">
  Token block size that providers cache prompts in. A turn counts as a cache miss in the run report only when the cached tokens fall at least this many tokens short of the previous prompt and the prompt did not shrink. Lower it for providers with smaller blocks (DeepSeek and GLM use 64; vLLM defaults to 16).
</ParamField>

### Dedicated deduplication model

Finding deduplication is a cheap, structured classification task. By default it
runs on the main model, but you can route it to a smaller/cheaper model without
affecting the agents that do the actual testing.

<ParamField path="MIKOSHI_DEDUPE_MODEL" type="string">
  Model used to judge whether a candidate finding duplicates an existing report.
  Falls back to `MIKOSHI_LLM` when unset.
</ParamField>

<ParamField path="DEDUPE_LLM_API_KEY" type="string">
  Optional provider key for the deduplication model.
</ParamField>

<ParamField path="DEDUPE_LLM_API_BASE" type="string">
  Optional custom API base URL for the deduplication model. Use when the dedupe
  model runs on a different endpoint than the main model.
</ParamField>

<ParamField path="DEDUPE_LLM_EXTRA_HEADERS" type="string">
  Optional JSON object of extra HTTP headers sent on every deduplication-model
  request, e.g. `{"X-Feature-Key":"value"}`. A dedicated dedupe model never
  inherits `LLM_EXTRA_HEADERS`; set this when its endpoint needs custom headers.
</ParamField>

<ParamField path="DEDUPE_LLM_EXTRA_BODY" type="string">
  Optional JSON object of extra request-body fields sent on every
  deduplication-model request. A dedicated dedupe model never inherits
  `LLM_EXTRA_BODY`; set this when its endpoint needs them too.
</ParamField>

<ParamField path="MIKOSHI_DEDUPE_REASONING_EFFORT" type="string">
  Reasoning effort for the deduplication model. Defaults to the model's own
  baseline when unset.
</ParamField>

## Optional Features

<ParamField path="PERPLEXITY_API_KEY" type="string">
  API key for Perplexity AI. Enables real-time web search during scans for OSINT and vulnerability research.
</ParamField>

<ParamField path="EXA_API_KEY" type="string">
  API key for Exa. Enables real-time web search through the Exa `/search` endpoint. Exa also powers the `web_get_contents` tool, which fetches the full text of a page through the Exa `/contents` endpoint. This is the preferred web search provider.
</ParamField>

<ParamField path="MIKOSHI_WEB_SEARCH_PROVIDER" default="auto" type="string">
  Web search provider: `auto`, `perplexity`, or `exa`. With `auto`, Mikoshi uses Exa when `EXA_API_KEY` is set, and Perplexity otherwise. Set an explicit provider to pin one when you configure both keys.
</ParamField>

<ParamField path="MIKOSHI_EXA_SEARCH_TYPE" default="auto" type="string">
  Exa search mode: `auto`, `fast`, `instant`, `deep-lite`, `deep`, or `deep-reasoning`. Lower modes return results faster. Higher modes plan across more steps and take more time. This setting applies only to the Exa provider.
</ParamField>

<ParamField path="MIKOSHI_EXA_NUM_RESULTS" default="5" type="integer">
  Number of Exa results to return, from `1` to `100`. Each result includes a title, a URL, and a short security-focused summary. To read a full page, the agent calls `web_get_contents` with the result URL. This setting applies only to the Exa provider.
</ParamField>

<ParamField path="POSTMAN_API_KEY" type="string">
  Postman API key (`PMAK-…`). Enables fetching Postman collections by id as a target (`postman://<collection-uid>`), and Postman environments (`postman://<collection-uid>?env=<environment-uid>`) to resolve collection variables. Not needed when passing a local collection export file.
</ParamField>

<ParamField path="MIKOSHI_TELEMETRY" default="1" type="string">
  Telemetry toggle. Set to `0`, `false`, `no`, or `off` to disable telemetry (PostHog, Scarf, OTEL).
</ParamField>

<ParamField path="MIKOSHI_RUN_RECORD_TIMINGS" default="false" type="boolean">
  Record every LLM request's and tool call's timing in `run.json`, under `llm_requests` and `tool_calls`. Adds about 0.5 MB to a typical scan's `run.json`.
</ParamField>

<ParamField path="MIKOSHI_SKILLS_DIR" type="string">
  Extra skill directories, separated by the OS path separator (`:` on Linux and macOS). Each directory uses the `<category>/<name>.md` layout of the built-in skills. Skills in these directories replace built-in skills with the same path. `--skills-dir` adds directories in front of this list. See [Skills](https://www.mikoshi.digital/docs/advanced/skills#add-your-own-skills).
</ParamField>

<ParamField path="TRACELOOP_BASE_URL" type="string">
  OTLP/Traceloop base URL for remote OpenTelemetry export. If unset, Mikoshi keeps traces local only.
</ParamField>

<ParamField path="TRACELOOP_API_KEY" type="string">
  API key used for remote trace export. Remote export is enabled only when both `TRACELOOP_BASE_URL` and `TRACELOOP_API_KEY` are set.
</ParamField>

<ParamField path="TRACELOOP_HEADERS" type="string">
  Optional custom OTEL headers (JSON object or `key=value,key2=value2`). Useful for Langfuse or custom/self-hosted OTLP gateways.
</ParamField>

When remote OTEL vars are not set, Mikoshi still writes complete run telemetry locally to:

```bash
mikoshi_runs/<run_name>/events.jsonl
```

When remote vars are set, Mikoshi dual-writes telemetry to both local JSONL and the remote OTEL endpoint.

## Docker Configuration

<ParamField path="MIKOSHI_IMAGE" default="ghcr.io/khkstudios/mikoshi-sandbox:1.4.2" type="string">
  Docker image to use for the sandbox container. The default image is private: pulling it requires access granted by Mikoshi ([contact us](https://www.mikoshi.digital/contact)), after which you sign in with `docker login ghcr.io`.
</ParamField>

<ParamField path="DOCKER_HOST" type="string">
  Docker daemon address, for example `unix:///var/run/docker.sock` or `tcp://10.0.0.5:2375`. When not set, Mikoshi connects to the same daemon as the `docker` CLI: the current docker context (`docker context use`), then the default socket. Docker Desktop, OrbStack and Colima register their sockets as contexts, so no extra configuration is needed for them.
</ParamField>

<ParamField path="MIKOSHI_RUNTIME_BACKEND" default="docker" type="string">
  Runtime backend for the sandbox environment.
</ParamField>

## Sandbox Configuration

<ParamField path="MIKOSHI_SANDBOX_EXECUTION_TIMEOUT" default="120" type="integer">
  Maximum execution time in seconds for sandbox operations.
</ParamField>

<ParamField path="MIKOSHI_SANDBOX_CONNECT_TIMEOUT" default="10" type="integer">
  Timeout in seconds for connecting to the sandbox container.
</ParamField>

## Config File

Mikoshi stores configuration in `~/.mikoshi/cli-config.json`. You can also specify a custom config file:

```bash
mikoshi --target ./app --config /path/to/config.json
```

**Config file format:**

```json
{
  "env": {
    "MIKOSHI_LLM": "openrouter/z-ai/glm-5.3",
    "LLM_API_KEY": "sk-...",
    "MIKOSHI_REASONING_EFFORT": "high"
  }
}
```

## Example Setup

```bash
# Required
export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
export LLM_API_KEY="sk-..."

# Optional: Enable web search (Exa preferred, Perplexity supported)
export EXA_API_KEY="..."
export PERPLEXITY_API_KEY="pplx-..."

# Optional: Custom timeouts
export LLM_TIMEOUT="600"
export MIKOSHI_SANDBOX_EXECUTION_TIMEOUT="300"

```

# Skills

Source: https://www.mikoshi.digital/docs/advanced/skills

> Specialized knowledge packages that enhance agent capabilities

Skills are structured knowledge packages that give Mikoshi agents deep expertise in specific vulnerability types, technologies, and testing methodologies.

## The Idea

LLMs have broad but shallow security knowledge. They know _about_ SQL injection, but lack the nuanced techniques that experienced pentesters use—parser quirks, bypass methods, validation tricks, and chain attacks.

Skills inject this deep, specialized knowledge directly into the agent's context, transforming it from a generalist into a specialist for the task at hand.

## How They Work

When Mikoshi spawns an agent for a specific task, it selects up to 5 relevant skills based on the context:

```python
# Agent created for JWT testing automatically loads relevant skills
create_agent(
    task="Test authentication mechanisms",
    skills=["authentication_jwt", "business_logic"]
)
```

The skills are injected into the agent's system prompt, giving it access to:

- **Advanced techniques** — Non-obvious methods beyond standard testing
- **Working payloads** — Practical examples with variations
- **Validation methods** — How to confirm findings and avoid false positives

## Skill Categories

### Vulnerabilities

Core vulnerability classes with deep exploitation techniques.

| Skill                                 | Coverage                                               |
| ------------------------------------- | ------------------------------------------------------ |
| `authentication_jwt`                  | JWT attacks, algorithm confusion, claim tampering      |
| `idor`                                | Object reference attacks, horizontal/vertical access   |
| `sql_injection`                       | SQL injection variants, WAF bypasses, blind techniques |
| `xss`                                 | XSS types, filter bypasses, DOM exploitation           |
| `ssrf`                                | Server-side request forgery, protocol handlers         |
| `csrf`                                | Cross-site request forgery, token bypasses             |
| `xxe`                                 | XML external entities, OOB exfiltration                |
| `rce`                                 | Remote code execution vectors                          |
| `business_logic`                      | Logic flaws, state manipulation, race conditions       |
| `race_conditions`                     | TOCTOU, parallel request attacks                       |
| `path_traversal_lfi_rfi`              | File inclusion, path traversal                         |
| `open_redirect`                       | Redirect bypasses, URL parsing tricks                  |
| `mass_assignment`                     | Attribute injection, hidden parameter pollution        |
| `insecure_file_uploads`               | Upload bypasses, extension tricks                      |
| `information_disclosure`              | Data leakage, error-based enumeration                  |
| `subdomain_takeover`                  | Dangling DNS, cloud resource claims                    |
| `broken_function_level_authorization` | Privilege escalation, role bypasses                    |

### Frameworks

Framework-specific testing patterns.

| Skill     | Coverage                                     |
| --------- | -------------------------------------------- |
| `fastapi` | FastAPI security patterns, Pydantic bypasses |
| `nextjs`  | Next.js SSR/SSG issues, API route security   |

### Technologies

Third-party service and platform security.

| Skill      | Coverage                                               |
| ---------- | ------------------------------------------------------ |
| `supabase` | Supabase RLS bypasses, auth issues                     |
| `firebase` | Firebase Firestore, Storage rules, Auth, and Functions |

### Protocols

Protocol-specific testing techniques.

| Skill     | Coverage                                         |
| --------- | ------------------------------------------------ |
| `graphql` | GraphQL introspection, batching, resolver issues |

### Reconnaissance

Asset discovery and network assessment workflows.

| Skill             | Coverage                                                        |
| ----------------- | --------------------------------------------------------------- |
| `asset_discovery` | CT, TLS SAN pivoting, passive DNS, and ASN/IP asset enumeration |
| `internal_network` | Corporate network discovery, AD infrastructure, file shares, management interfaces, lateral trust paths, and segmentation |

### Tooling

Sandbox CLI playbooks for core recon and scanning tools.

| Skill       | Coverage                                                |
| ----------- | ------------------------------------------------------- |
| `nmap`      | Port/service scan syntax and high-signal scan patterns  |
| `nuclei`    | Template selection, severity filtering, and rate tuning |
| `httpx`     | HTTP probing and fingerprint output patterns            |
| `ffuf`      | Wordlist fuzzing, matcher/filter strategy, recursion    |
| `subfinder` | Passive subdomain enumeration and source control        |
| `naabu`     | Fast port scanning with explicit rate/verify controls   |
| `katana`    | Crawl depth/JS/known-files behavior and pitfalls        |
| `sqlmap`    | SQLi workflow for enumeration and controlled extraction  |

## Skill Structure

Each skill is a Markdown file with YAML frontmatter for metadata:

```markdown
---
name: skill_name
description: Brief description of the skill's coverage
---

# Skill Title

Key insight about this vulnerability or technique.

## Attack Surface
What this skill covers and where to look.

## Methodology
Step-by-step testing approach.

## Techniques
How to discover and exploit the vulnerability.

## Bypass Methods
How to bypass common protections.

## Validation
How to confirm findings and avoid false positives.
```

## Load skills yourself

Agents pick skills from a catalog of names and one-line descriptions. The pick depends on the subtask the agent was given. To make sure the root agent starts with a skill, name it on the command line:

```bash
mikoshi --target https://api.example.com --skills idor,mass_assignment
mikoshi --target https://api.example.com --skills vulnerabilities/idor,custom/my_method
```

Mikoshi loads the named skills into the root agent's system prompt before the scan starts. The root agent can still pass them to child agents with `create_agent(skills=[...])`. An unknown name stops the run and prints the available skills. A resumed scan keeps the skills of the original run.

## Add your own skills

Point Mikoshi at a directory that uses the same `<category>/<name>.md` layout as the built-in skills:

```bash
mikoshi --target https://app.com --skills-dir ./my-skills --skills custom/my_method
```

```text
my-skills/
├── custom/
│   └── my_method.md
└── vulnerabilities/
    └── idor.md        # replaces the built-in idor skill
```

Repeat `--skills-dir` for more directories, or set `MIKOSHI_SKILLS_DIR` to a list of directories separated by the OS path separator. Mikoshi searches these directories before the packaged skills. A file with the same path as a built-in skill replaces it. This works for installed builds too, so you do not have to rebuild the package to add a skill.

Mikoshi lists your skills first in the catalog, before the built-in skills, and marks them as operator skills. When one of your skills fits a task, agents load it or assign it before a built-in skill. Mikoshi does not load your skills into an agent automatically. To do that for the root agent, use `--skills`.

Each file needs the frontmatter `description` field. Agents only see the name and this description in the catalog, so write the description for the subtask that should trigger the skill.

## Skills or instructions?

<Note>
A skill is specialist knowledge for one agent: a vulnerability class, a technology, a tool, or a target-specific quirk. An agent loads a skill when the skill matches its subtask.

An instruction file is the engagement rulebook: scope, credentials, coordination rules, shared artifacts, and completion criteria. Every agent sees the instructions. See [Custom Instructions](https://www.mikoshi.digital/docs/usage/instructions#reusable-methodology).
</Note>

A cross-cutting methodology that spans the whole engagement belongs in an instruction file. If the methodology also needs knowledge that the built-in skills do not have, put that part in a custom skill and name it from the instruction file.

## Writing Good Skills

Built-in skills are maintained by the Mikoshi team; to suggest one, [contact us](https://www.mikoshi.digital/contact). For your own skills, create a `.md` file with YAML frontmatter (`name` and `description` fields) and load it with `--skills-dir`. Good skills include:

1. **Real-world techniques** — Methods that work in practice
2. **Practical payloads** — Working examples with variations
3. **Validation steps** — How to confirm without false positives
4. **Context awareness** — Version/environment-specific behavior

# Development

Source: https://www.mikoshi.digital/docs/contributing

> Working on Mikoshi (Mikoshi team only)

<Note>
Mikoshi is closed source. Its code lives in the private repository github.com/khkstudios/Mikoshi, which only the Mikoshi team can access. This page is for team members. To report a bug or request a feature, [contact us](https://www.mikoshi.digital/contact).
</Note>

## Development Setup

### Prerequisites

- Python 3.12+
- Latest Go 1.24.x patch (only for Bubble Tea TUI development and release artifacts)
- Docker (running)
- [uv](https://docs.astral.sh/uv/)
- Git

### Local Development

<Steps>
  <Step title="Clone the repository">
    ```bash
    git clone git@github.com:khkstudios/Mikoshi.git
    cd Mikoshi
    ```
  </Step>
  <Step title="Install dependencies">
    ```bash
    make setup-dev

    # or manually:
    uv sync
    uv run pre-commit install
    ```
  </Step>
  <Step title="Configure LLM">
    ```bash
    export MIKOSHI_LLM="openrouter/z-ai/glm-5.3"
    export LLM_API_KEY="your-api-key"
    ```
  </Step>
  <Step title="Run Mikoshi">
    ```bash
    uv run mikoshi --target https://example.com
    ```
  </Step>
</Steps>

## Adding Skills

Skills are specialized knowledge packages that enhance agent capabilities. They live in `mikoshi/skills/`

### Creating a Skill

1. Choose the right category
2. Create a `.md` file with YAML frontmatter (`name` and `description` fields)
3. Include practical examples—working payloads, commands, test cases
4. Provide validation methods to confirm findings
5. Open a pull request

## Changing Code

### Pull Request Process

1. **Track the work** — Describe the problem or feature in an issue on the private repository
2. **Branch** — Create a branch from `main`
3. **Make changes** — Follow existing code style
4. **Write tests** — Ensure coverage for new features
5. **Run checks** — `make check-all` should pass
6. **Submit PR** — Link to issue and provide context

### Code Style

- PEP 8 with 100-character line limit
- Type hints for all functions
- Docstrings for public methods
- Small, focused functions
- Meaningful variable names

## Package Builds

Editable installs do not require Go; they run the TUI from source (`go run`).

Wheels are intentionally strict: they always bundle the matching Go sidecar and
are platform-specific.

```bash
make wheel
```

The build hook (`scripts/tui_sidecar_hook.py`) requires Go 1.24.x or newer, embeds
the sidecar as `mikoshi/bin/mikoshi-tui`, and assigns the current platform tag.
Frozen releases built by `scripts/build.sh` and `mikoshi.spec` also require the
sidecar.

## Reporting Issues

Include:

- Python version and OS
- Mikoshi version (`mikoshi --version`)
- LLM being used
- Full error traceback
- Steps to reproduce

## Support

<Card title="Support" icon="envelope" href="https://www.mikoshi.digital/contact">
  Report bugs and request features.
</Card>

# Introduction

Source: https://www.mikoshi.digital/docs/cloud/overview

> The Mikoshi app: request and track managed security testing

The Mikoshi app at [mikoshi.digital/app](https://www.mikoshi.digital/app) is where customers register what they want tested, request scans, and collect results. You don't need Docker, an LLM key or a local install.

<Note>
The app is an early release. Scans you request are run by the Mikoshi team, and you are emailed when results are ready. Self-serve scans that start automatically, team dashboards and pull-request scanning are planned.
</Note>

## What you can do today

<CardGroup cols={2}>
  <Card title="Register assets" icon="globe">
    Add a web app URL or a GitHub repository, with a recorded statement that you are authorised to test it.
  </Card>
  <Card title="Request scans" icon="play">
    Choose a quick, standard or deep scan. The request is queued and the Mikoshi team is notified.
  </Card>
  <Card title="Track progress" icon="list-check">
    Follow each scan from queued to running to completed, and cancel it while it is still queued.
  </Card>
  <Card title="Collect results" icon="file-lines">
    Review validated findings sorted by severity, with remediation guidance, and download the full report.
  </Card>
</CardGroup>

## Getting started

1. Create an account at [mikoshi.digital/app/sign-up](https://www.mikoshi.digital/app/sign-up).
2. Name your organisation.
3. Add an asset and confirm you are authorised to test it.
4. Request a scan. You'll get an email when the results are ready.

Only register systems you own or have written permission to test. See the [acceptable use policy](https://www.mikoshi.digital/acceptable-use).

## From the terminal (planned)

The `mikoshi cloud` commands in the CLI are designed for a managed API that is not live yet. Until it is, use the app above, or run the [Mikoshi CLI](https://www.mikoshi.digital/download) yourself. The [cloud CLI reference](https://www.mikoshi.digital/docs/cloud/cli) describes the planned interface.

<Card title="Open the Mikoshi app" icon="rocket" href="https://www.mikoshi.digital/app">
  Register an asset and request your first scan.
</Card>

# Cloud CLI

Source: https://www.mikoshi.digital/docs/cloud/cli

> Drive app.mikoshi.digital from the terminal with mikoshi cloud

The `mikoshi cloud` commands drive the managed platform ([app.mikoshi.digital](https://app.mikoshi.digital)) from the terminal. You do not need Docker or an LLM key.

## Sign In

Sign in once with the browser device flow. The sign-in creates your account and workspace on first use, and it stores a personal API token in `~/.mikoshi/platform-auth.json`.

```bash
mikoshi cloud login                         # browser approval, then workspace and scope profile
mikoshi cloud login --workspace "My Team"   # select a workspace by name or ID
mikoshi cloud whoami                        # local account and workspace status
mikoshi cloud session                       # verify the remote session and consent ceiling
mikoshi cloud logout                        # revoke remotely, then remove the local token
```

A browser sign-in creates one reusable credential for each CLI installation. A second sign-in on the same installation replaces the secret instead of adding another key. `mikoshi cloud logout` revokes the server session before it deletes the local token. Use `--local-only` when you cannot reach the server.

## Scopes

The default **Recommended** preset covers normal scan work, local source uploads, workspace switching, and user-approved credit top-ups. It excludes credential creation, so request `tokens:write` when you need it.

```bash
mikoshi cloud login --scopes scans:read scans:write uploads:write billing:read
mikoshi cloud login --scope-profile minimal   # also accepts recommended or full
mikoshi cloud session scopes                  # granted scopes and the login ceiling
mikoshi cloud session scopes set minimal      # narrow without another browser sign-in
```

A workspace switch keeps the credential and its expiry, preserves the server-side scope preference, and caps access by the target role. A switch can never exceed the login consent ceiling. Each process pins the workspace it started with, so a concurrent switch fails safely instead of sending a stale command to another organization.

## Commands

Every operation of the [REST API](https://docs.app.mikoshi.digital) has a matching command in the form `mikoshi cloud <resource> <verb>`.

```bash
mikoshi cloud                                   # list all resources
mikoshi cloud scans                             # run the safe default (scans list)
mikoshi cloud scans help                        # list the verbs of a resource
mikoshi cloud domains add --domain example.com --asset-type web_app
mikoshi cloud scans start --engagement-type live_test --domain-ids <uuid> --wait
mikoshi cloud vulns list --severity critical
mikoshi cloud credits                           # credit balance
```

Write commands take request fields as flags. Every write command also accepts one JSON object with `--data`:

```bash
mikoshi cloud scans start --data '{"engagement_type":"code_review"}'   # literal JSON
mikoshi cloud scans start --data @request.json                         # read a file
cat request.json | mikoshi cloud scans start --data -                  # read standard input
```

`--token` and `MIKOSHI_API_TOKEN` are stateless overrides for a single command, and they never replace the stored sign-in. Pair a CLI-session override with `--workspace-id` or `MIKOSHI_WORKSPACE_ID`.

## Workspaces And Account Setup

```bash
mikoshi cloud workspaces list                       # numbered list; workspace is also accepted
mikoshi cloud workspaces create --name "My Team"    # needs admin and organizations:write
mikoshi cloud workspaces use 2                      # switch by list number, exact name, or ID
mikoshi cloud billing topup --credits 20 --yes      # approve an agent payment after HTTP 402
mikoshi cloud billing subscribe --plan mikoshi_cloud  # opens the hosted checkout page
mikoshi cloud billing portal                        # opens the billing portal
mikoshi cloud integrations install github           # opens the app installation page
mikoshi cloud domains verify <domain-id>            # prints the DNS record to add
```

The last four commands end at a person. Mikoshi creates the link, opens the browser for an interactive terminal, and always prints the URL. The user enters the card, approves the installation, or adds the DNS record. Pass `--no-browser` to print the URL only.

## Output And Exit Codes

The commands work for people and for agents. Terminal output favors names, branches, lifecycle states, and numbered selectors. Redirected output, and `--json`, preserve the complete machine-readable record.

- Human lists keep the selectors that follow-up commands need, and they omit internal organization and user IDs. A selector that is too long for the compact table is repeated losslessly in a copyable block.
- Paginated lists print the next `--page` or `--offset`. Detail views keep useful prose within a safe terminal bound, so use `--json` for the complete record.
- Token lists separate API keys from named CLI device sessions.
- Binary downloads are the exception to JSON output. Redirect the raw bytes on purpose, or use `--output FILE --json` to write the file and receive structured download metadata.
- There are no prompts when stdin is not a terminal.

Exit codes: `0` success, `1` error, `2` invalid usage, `4` authentication or plan limit, `5` payment required.

## Credits And Plan Limits

Non-Enterprise scans consume the deterministic estimate shown for their scope. A source-only code review currently starts at 60 credits. Enterprise scans are plan-included and do not consume the credit wallet.

Report downloads need Enterprise, schedules need Pro, and billing writes need an admin token. A plan block exits `4`. An insufficient credit wallet exits `5` without the creation of a scan and without a charge.

## Local Source Scans

See [Scan Local Source](https://www.mikoshi.digital/docs/cloud/overview#scan-local-source) for the upload approval flow, the exclusion rules, and the size limits.

## Tab Completion

Enable native tab completion once for each shell session:

```bash
source <(mikoshi completions zsh)       # use bash instead of zsh when appropriate
mikoshi completions fish | source
```
