Skip to content
SannroxPublic

About

Local-first headless agent harness with pluggable governance adapters.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

413 Commits

Folders and files

shikigami (式神)

A local-first headless agent harness: autonomous agent work as countable runs.

CI Release License

Try it · Docs · Design · Settings · Decisions

Status: v3.0.0. Freeze-core library, settings, run, doctor JSON, and offline OSS paths follow semver under ADR 0004. Additive evolution remains allowed on documented evolving/host-only surfaces (e.g. MCP). Offline cargo test is the supported baseline.

Shikigami (式神, the conjured familiar that carries out tasks for its summoner) runs autonomous agent work as countable runs: materialize a workspace, call a model, execute jailed tools, emit progress, and finish with a structured result — without a desktop UI. It is a local guest. When a governance plane is required, the caller is rusui (ADR 0024).

  • Headless by default. The same runs execute unattended in CI, on fleet hosts, or under an operator; a desktop shell is a client, never the runtime.
  • One shared core. CLI, serve daemon, MCP, ACP, TUI, and in-process embedders all drive the same Harness library instead of reimplementing the loop.
  • Settings select adapters. The loop is fixed; governance, model, workspace, and event adapters are picked by versioned TOML, so different use cases do not require forking the core (ADR 0001).
  • Fail closed on trust. Jail, sandbox, and session ask=park do not silently degrade. Settings that name the retired plane client fail at resolve.
  • Jailed tools. Tools operate inside the run workspace; Bash and other high-risk tools are opt-in, with settings-selected OS sandbox backends (ADR 0013).
  • Offline deterministic baseline. cargo test and the quickstart below pass with no control plane and no API keys.

Library upgrades from 2.x: see the 3.0 upgrade notes. 1.x to 2.0: see the 2.0 upgrade notes. Removing the in-tree plane client is ADR 0024.

Path What you get
Local / OSS Scripted or HTTP models. Deterministic tests. Session hosts ask before mutating tools.
Plane (caller) rusui speaks sekai-chisei and spawns this guest over ACP.
Delivery Optional packaging via tenkai. Delivery is not a runtime dependency.

Try it

No control plane, no API keys — uses the built-in scripted model:

git clone https://github.com/Sannrox/shikigami.git
cd shikigami
cargo build --release

./target/release/shikigami doctor
./target/release/shikigami --config examples/local-run.toml run "demo" --keep-workspace

doctor prints the effective profile, adapters, and tool set and ends with status: ok. The run writes SHIKIGAMI_OK.txt under the run workspace and reports success (paths shortened):

run b7d182a5-273a-4082-87d3-5eebd355eb85 turns=2 success=true termination=completed summary=scripted run complete
workspace .../runs/b7d182a5-273a-4082-87d3-5eebd355eb85/workspace
artifacts .../runs/b7d182a5-273a-4082-87d3-5eebd355eb85/artifacts

Chat in the terminal

shikigami tui works with an agent on the current directory: it reads and edits your files and asks before each change. Start it in a scratch folder first. With no settings it runs the built-in demo, which says so on screen. From the clone:

export PATH="$PWD/target/release:$PATH"
mkdir -p /tmp/shikigami-try && cd /tmp/shikigami-try
shikigami tui

Type a prompt and press Enter. The demo asks to write SHIKIGAMI_OK.txt into a scratch directory it names, not your project; press y to allow it. /help lists keys and commands; Ctrl-C quits.

To use a real model, create a settings file in that folder and point it at any OpenAI-compatible endpoint. The key stays in the environment, never in the file:

# model.toml
version = 1

[model]
adapter = "http"
base_url = "https://<your-endpoint>/v1"
model = "<model id>"
api_key_env = "MODEL_API_KEY"
export MODEL_API_KEY="…"
shikigami --config model.toml doctor   # checks the file and the key
shikigami --config model.toml tui

shikigami tui --continue reopens the last session in that folder. See docs/tui.md for keys and commands, and examples/cliproxy-http.toml for a local gateway.

Requirements

  • Rust toolchain pinned in rust-toolchain.toml (Rust 2024)
  • macOS or Linux (primary targets today)
  • Optional: OpenAI-compatible HTTP endpoint for http model turns

Prebuilt binaries

Tagged releases publish multi-arch archives from GitHub Actions (Releases):

Archive suffix Target
aarch64-apple-darwin Apple Silicon macOS
x86_64-apple-darwin Intel macOS
x86_64-unknown-linux-gnu Linux x86_64
aarch64-unknown-linux-gnu Linux aarch64

Each archive includes a sha256 checksum. Prefer building from source when you need a custom feature set.

How it works

flowchart LR
  O[operator / CI / rusui / embedder] --> H[Harness]
  H --> W[materialize workspace]
  W --> T[turn loop]
  T --> M[model adapter<br>scripted / http]
  T --> X[jailed tools]
  T --> E[progress events]
  T --> R[structured outcome]
  G[governance adapter<br>none / local / http-callback] -. allow-list and host authz,<br>fails closed when required .-> T
Loading

A run is one countable unit of work: a materialized workspace, a model turn loop, jailed tool calls, and a structured outcome. Every external dependency sits behind a port; settings select the adapter for each port (ADR 0001).

  • Core owns run lifecycle, workspace materialization, tool jail, event emission. The engine always calls ModelPort.
  • Adapters own local governance (none / local / http-callback), model source, workspace kind, and event sinks.
  • rusui (when used) owns plane policy, model proxying, and receipts, and spawns this process over ACP.
  • tenkai (when used) owns shipping the binary — never process config.

Details: VISION.md, DESIGN.md, docs/adapters.md.

Next steps

Choose a process host for the common integration paths:

  • CLI: one-shot operator and CI use (doctor / run) — CLI reference
  • serve: long-running filesystem queue — serve guide
  • MCP stdio: IDE and tool clients — MCP guide
  • ACP / TUI: session guest and interactive terminal host — ACP, TUI
  • Library: advanced in-process integrations that need direct results, cancellation, events, or metrics — embedding guide

Settings are versioned TOML. Select adapters and explicit policy settings for your use case; see the configuration reference for the schema, environment variables, resolution order, and compatible version-1 profiles. New configurations should specify adapters and governance.fail_closed explicitly.

Examples:

Contributing

See CONTRIBUTING.md for development setup and project verification for the deterministic gates. Agent/repo operating rules: AGENTS.md.

Documentation map

Document Audience
VISION.md Why this product exists
DESIGN.md Architecture and boundaries
docs/README.md Full documentation index
docs/cli.md CLI command and option reference
docs/decisions/0024-local-guest-rusui-plane-caller.md Local guest; rusui is the plane caller
CONTEXT.md Domain glossary and naming
docs/settings.md Configuration reference
docs/adapters.md Ports and built-in adapters
docs/embedding.md Library integration
docs/decisions/ Accepted ADRs
CHANGELOG.md Notable changes
SECURITY.md Vulnerability reporting
CODE_OF_CONDUCT.md Community norms

License

Licensed under the Apache License, Version 2.0.

About

Local-first headless agent harness with pluggable governance adapters.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages