Security-first AI agent daemon
Project description
ShisaD (shisad)
Security-first AI agent daemon framework.
ShisaD is a long-running daemon that sits between an LLM and external systems (tools, files, network, messaging channels). The model proposes actions; the runtime decides what actually executes — every tool call passes through policy enforcement, taint tracking, and audit before anything happens.
The core question at every action is: who asked for it? ShisaD is the user's agent — it exists to do what the user asks with the highest possible fidelity, and to prevent anything else (prompt injection, hallucination, attacker-controlled input) from taking control.
Rather than ignoring the elephant in the room, our design targets the lethal trifecta head-on: agents that access private data, process untrusted content, and take consequential actions are inherently high-risk. Most agent security research solves this by removing capabilities until the agent is safe but useless. ShisaD takes the opposite approach: keep the agent fully capable and build enforcement infrastructure that makes each capability safe to use at runtime. If a tool is insecure, the goal is to fix the enforcement, not disable the tool.
┌─────────────────┐
│ LLM (Planner) │
Untrusted ─────────►│ [tokens mix] │─────────► Proposed
Content │ │ Actions
└─────────────────┘
│
═══════════════════════════════════════════════════════════
║ ARCHITECTURAL BOUNDARY ║
═══════════════════════════════════════════════════════════
│
▾
┌─────────────────┐ ┌─────────────┐
│ Trusted Config │ │ Security │
│ (policies, │ │ Analyzers │
│ goals) │ │ (metadata │
└─────────────────┘ │ only) │
└──────┬──────┘
▾
APPROVE / REJECT
Features
- Structured long-term memory — separate identity, active-attention, recall, procedural, and evidence surfaces share a versioned local store with provenance-gated writes, review gates for high-risk paths, and auditable provenance
- COMMAND/TASK orchestration runtime — persistent COMMAND sessions hand off delegated work to isolated TASK sessions with taint-safe summaries, approval provenance, and explicit task envelopes
- Per-call policy enforcement — 8-layer PEP pipeline (registry, schema, capability, DLP, resource authorization, egress allowlisting, credential scoping, taint sink enforcement) runs on every tool call, not just at session start
- Taint-aware content handling — ingress/egress content firewalls track provenance of untrusted input through the execution path
- Confirmation gates, not blanket denial — user-requested actions proceed; ambiguous or tainted actions route to confirmation; only genuine anomalies trigger lockdown
- Behavioral anomaly detection — control plane consensus (5 independent voters) for runtime anomaly detection, rate limiting, lockdown escalation, and user-visible warnings on repeated suspicious deny patterns
- Destructive command protection — enforced at the sandbox policy layer before execution, not by LLM judgment; structurally incapable of
rm -rf /regardless of prompt injection or misconfiguration - Clean-room workflows — admin operations run in a taint-isolated session mode with no auto-apply
- Multi-channel messaging — Matrix, Discord, Telegram, Slack (Socket Mode), with default-deny identity allowlisting per channel
- Assistant primitives — notes/todos, scheduler with shared delivery, web search/fetch, baseline browser automation, filesystem/git helpers, and evidence references for large untrusted output
- Artifact and evidence boundaries — restart-stable evidence refs, structured ArtifactLedger storage, and terminal-safe evidence rendering keep large untrusted content off the raw prompt path by default
- Intent-grounded execution — risky actions must trace back to committed user or clean COMMAND intent, with missing-path reads routed to confirmation and missing-path side effects blocked
- Provider routing — pluggable LLM provider presets (Shisa, OpenAI, OpenRouter, Google, local vLLM) with per-route auth, model selection, and mixed-mode deployment
- Tool-surface integrity — reviewed local skills can declare tools, but their schema hashes are pinned across install/restart/runtime, drifted reviewed tools fail closed with explicit audit visibility, and dynamic remote tool discovery remains fail-closed
- Observability — comprehensive audit trail, TUI dashboard (pending actions, tasks, channel health, alerts), and
doctordiagnostics
Status
This repo is public and still pre-alpha. The latest published line is
v0.7.3: open-thread/topic resume, fuzzy timeline/archive search,
procedure-experience candidates, and timeline/procedure security hardening on
top of the structured long-term memory line.
| Version | Focus |
|---|---|
| v0.7 | Memory foundation + long-term memory surfaces (latest published: v0.7.3 open threads, timeline search, and procedural-memory pilot) |
| v0.6 | Orchestration foundation + tool-surface expansion (COMMAND/TASK runtime, credential scoping, web tools, browser baseline) |
| v0.5 | First public release — evidence references, repo split, zero-config SHISA provider |
| v0.4 | Self-modification, coding-agent runtime, COMMAND/TASK isolation |
| v0.3 | Provider routing, channels, assistant tools, destructive command protection |
| v0.2 | Structural refactor (typed handlers, decomposed runtime, coverage) |
| v0.1 | Core daemon, PEP security pipeline, control API |
This table tracks major release lines for reader orientation; patch releases
like v0.5.1 and v0.5.2 stay in the changelog rather than being listed here.
See docs/ROADMAP.md for more details.
Getting Started
shisadis currently PRE-ALPHA software and probably won't do what you think it will if you're not a developer. The easiest way to get setup is to point Claude Code, OpenAI Codex, or some other strong coding agent to install. When it's more baked, the installation procedure will be better.
Users and agents looking to set up ShisaD on their own system should see docs/DEPLOY.md for the full bring-up guide — host bootstrap, provider configuration, channel setup (Discord, Telegram, Slack), and troubleshooting. ShisaD is designed to run on a dedicated instance or container, not inside your development environment.
Quick Start
git clone https://github.com/shisa-ai/shisad.git
cd shisad
uv sync --group dev --extra chat
YARA-backed content scanning is included in the base install through
textguard[yara]. For local PromptGuard runtime checks from a source checkout,
add the security runtime dependency group:
uv sync --group security-runtime --group dev --extra chat
For package installs, use the first-class PromptGuard extra, for example
uv pip install 'shisad[promptguard]'. security-runtime is a uv dependency
group, not a pip extra; use --group security-runtime, not
--extra security-runtime. The chat and promptguard package sets are
project optional extras and use --extra chat / shisad[promptguard].
Configuration
Environment variables use SHISAD_ prefixes. Full reference: docs/ENV-VARS.md.
Recommended: use the runner harness for local development. It handles env isolation, secret loading, and policy bootstrapping:
bash runner/harness.sh start # background (requires tmux)
bash runner/harness.sh start --fg # foreground
bash runner/harness.sh status
See runner/README.md for details. Secrets go in runner/.env (gitignored) or SHISAD_ENV_FILE.
Manual baseline
export SHISAD_DATA_DIR="$HOME/.local/share/shisad"
export SHISAD_SOCKET_PATH="/tmp/shisad/control.sock"
export SHISAD_POLICY_PATH="$PWD/.local/policy.yaml"
export SHISAD_LOG_LEVEL="INFO"
Provider routing
Default (Shisa.AI):
# Planner route remote-enables implicitly when SHISA key resolves.
export SHISA_API_KEY="<shisa-api-key>"
OpenAI:
export SHISAD_MODEL_REMOTE_ENABLED=true
export OPENAI_API_KEY="<openai-api-key>"
export SHISAD_MODEL_PLANNER_PROVIDER_PRESET="openai_default"
export SHISAD_MODEL_PLANNER_MODEL_ID="gpt-5.4-2026-03-05"
# Optional: export SHISAD_MODEL_PLANNER_REQUEST_PARAMETERS='{"max_completion_tokens":512}'
OpenRouter:
export SHISAD_MODEL_REMOTE_ENABLED=true
export OPENROUTER_API_KEY="<openrouter-api-key>"
export SHISAD_MODEL_PLANNER_PROVIDER_PRESET="openrouter_default"
export SHISAD_MODEL_PLANNER_MODEL_ID="qwen/qwen3.5-397b-a17b"
export SHISAD_MODEL_PLANNER_EXTRA_HEADERS='{"HTTP-Referer":"https://example.com","X-Title":"shisad"}'
Google (OpenAI-compatible):
export SHISAD_MODEL_REMOTE_ENABLED=true
export GEMINI_API_KEY="<gemini-api-key>"
export SHISAD_MODEL_PLANNER_PROVIDER_PRESET="google_openai_default"
export SHISAD_MODEL_PLANNER_MODEL_ID="gemini-3.1-pro-preview"
Local vLLM:
export SHISAD_MODEL_PLANNER_PROVIDER_PRESET="vllm_local_default"
export SHISAD_MODEL_PLANNER_BASE_URL="http://127.0.0.1:8000/v1"
export SHISAD_MODEL_PLANNER_REMOTE_ENABLED=true
export SHISAD_MODEL_PLANNER_AUTH_MODE="none"
Mixed mode (planner remote, embeddings local, monitor remote):
export SHISAD_MODEL_REMOTE_ENABLED=true
export SHISAD_MODEL_PLANNER_PROVIDER_PRESET="openrouter_default"
export SHISAD_MODEL_PLANNER_MODEL_ID="qwen/qwen3.5-397b-a17b"
export SHISAD_MODEL_PLANNER_API_KEY="<planner-openrouter-key>"
export SHISAD_MODEL_EMBEDDINGS_PROVIDER_PRESET="vllm_local_default"
export SHISAD_MODEL_EMBEDDINGS_BASE_URL="http://127.0.0.1:8000/v1"
export SHISAD_MODEL_EMBEDDINGS_REMOTE_ENABLED=true
export SHISAD_MODEL_EMBEDDINGS_AUTH_MODE="none"
export SHISAD_MODEL_EMBEDDINGS_MODEL_ID="text-embedding-3-small"
export SHISAD_MODEL_MONITOR_PROVIDER_PRESET="openai_default"
export SHISAD_MODEL_MONITOR_API_KEY="<monitor-openai-key>"
export SHISAD_MODEL_MONITOR_MODEL_ID="gpt-5.4-2026-03-05"
Verify provider setup:
uv run shisad doctor check --component provider
Auth notes:
- Use
*_auth_mode=headerwhen custom auth header names are required. *_auth_header_nameis not accepted for*_auth_mode=bearer|none.
Channels
export SHISAD_DISCORD_ENABLED=true
export SHISAD_DISCORD_BOT_TOKEN="<token>"
export SHISAD_TELEGRAM_ENABLED=true
export SHISAD_TELEGRAM_BOT_TOKEN="<token>"
export SHISAD_SLACK_ENABLED=true
export SHISAD_SLACK_BOT_TOKEN="<xoxb-token>"
export SHISAD_SLACK_APP_TOKEN="<xapp-token>"
# Default-deny allowlist: channel -> [external_user_id]
export SHISAD_CHANNEL_IDENTITY_ALLOWLIST='{"discord":["1234567890"],"telegram":["11111"],"slack":["U12345"]}'
Assistant surfaces
# web_fetch and web_search are enabled by default.
# web_search needs a compatible JSON search backend (SearxNG-style /search?q=...&format=json).
# The backend host must also be present in SHISAD_WEB_ALLOWED_DOMAINS.
export SHISAD_WEB_SEARCH_BACKEND_URL="https://search.example.com"
export SHISAD_WEB_ALLOWED_DOMAINS='["search.example.com","docs.example.com"]'
# Verify the configured tool surface from a live daemon:
# uv run python scripts/live_tool_matrix.py --tool-status
# Optional: browser automation baseline (read-mostly navigation plus
# confirmation-gated write actions). The built wheel does not install this
# source-checkout wrapper; package installs need an explicit compatible wrapper.
export SHISAD_BROWSER_ENABLED=true
export SHISAD_BROWSER_COMMAND="/path/to/shisad/scripts/shisad-playwright-cli.mjs"
export SHISAD_BROWSER_ALLOWED_DOMAINS='["example.com"]'
export SHISAD_ASSISTANT_FS_ROOTS='["/tmp/shisad-workspace"]'
Usage
Start and verify
uv run shisad start --foreground
In another shell:
uv run shisad status
uv run shisad doctor check --component all
uv run shisad tui --plain
Sessions
uv run shisad session create --user alice --workspace demo
uv run shisad session list
uv run shisad session message <session-id> "summarize current priorities"
Session-derived conversation summaries can create durable memory entries by
default when the session has memory.write; resulting writes are owner-scoped
when the session has a complete --user / --workspace owner tuple. For clean
demos or workspaces where ordinary chat should not create automatic memory, set
SHISAD_MEMORY_AUTO_EXTRACTION_ENABLED=false. Operators can also raise
SHISAD_MEMORY_AUTO_EXTRACTION_CONFIDENCE_THRESHOLD from 0 toward 1 to keep
only higher-confidence automatic extraction proposals.
Timeline search
uv run shisad memory timeline search "what did we decide last week?" --user alice --workspace demo
uv run shisad memory timeline read <timeline-handle> --user alice --workspace demo
uv run shisad memory timeline promote <timeline-handle> --type fact --key project/decision --user alice --workspace demo
Timeline search is explicit-pull only. Results are archival evidence from prior
session transcripts, not current user instructions, and shared/public channel
contexts do not reveal owner-private history unless private history is
explicitly allowed for that request. Read packets include role, source surface,
provenance, taints, evidence refs, and content digests; search/read/promote
decisions are recorded in the audit log without raw query or snippet text. For
shared-channel contexts, pass the concrete room binding with --recipient,
--workspace-hint, and --thread-id so same-connector/different-room history
stays isolated.
Notes and todos
uv run shisad note create --key ops/runbook --content "verify doctor before deploy" --user alice --workspace demo
uv run shisad note list --user alice --workspace demo
uv run shisad todo create --title "close rollout checklist" --status open --user alice --workspace demo
uv run shisad todo list --user alice --workspace demo
Web and filesystem
uv run shisad web search "shisad security architecture" --limit 5
uv run shisad web fetch https://example.com
uv run shisad fs read /tmp/shisad-workspace/notes.txt
uv run shisad fs write /tmp/shisad-workspace/out.txt --content "hello" --confirm
uv run shisad git status --repo /tmp/shisad-workspace
Admin clean-room
uv run shisad session mode <session-id> --mode admin_cleanroom
uv run shisad channel pairing-propose --limit 50
Security Model
shisad assumes prompt injection will succeed and builds enforcement outside the model. The LLM is a planner, not an executor — it proposes tool calls, but the runtime pipeline decides whether each call proceeds, requires confirmation, or gets blocked. No amount of prompt injection, jailbreaking, or misconfiguration can override the enforcement layers because they run in a separate trust domain from the model.
The problem: any agent with access to private data (files, email), exposure to untrusted content (web pages, API responses), and the ability to take consequential actions (send messages, write files) is exploitable. This is the lethal trifecta. shisad has all three by design — it's meant to be a useful assistant, not a sandboxed demo.
The approach: instead of removing capabilities until the agent is safe (at which point you've rebuilt ChatGPT with extra steps), shisad keeps all capabilities available and enforces safety per-call:
- 8-layer PEP pipeline on every tool call: registry check, schema validation, capability check, DLP (secret pattern detection), resource authorization, egress allowlisting, credential host-scoping, taint sink enforcement
- Taint tracking: content firewalls tag untrusted input on ingress and enforce provenance-aware restrictions on egress — the runtime knows who asked for each action (user vs. injected content vs. model hallucination)
- Confirmation gates: user-requested actions proceed; actions with ambiguous or tainted provenance route to user confirmation with context; only genuine anomalies trigger lockdown
- Behavioral anomaly detection: control plane consensus (5 independent voters) catches patterns that individual call-level checks miss
- Destructive command protection: enforced at the sandbox layer before execution, not by LLM judgment — structurally incapable of
rm -rf /regardless of what the model is tricked into proposing
Default posture: all tools available out of the box. Operators who need a restrictive posture deploy an explicit policy via SHISAD_POLICY_PATH.
Egress model: allowlists auto-approve known-good destinations. Explicit user requests proceed without confirmation. Destinations suggested only by untrusted content route through confirmation with warning. Unattributed/hallucinated drift is blocked.
See docs/SECURITY.md for the full security architecture and docs/DESIGN-PHILOSOPHY.md for the governing principles.
Architecture
shisad/
├── src/shisad/ # Core source
│ ├── daemon/ # Control API, handlers, runtime implementation
│ ├── security/ # PEP pipeline, content firewalls, taint tracking
│ ├── executors/ # Tool execution, egress proxy
│ ├── channels/ # Matrix, Discord, Telegram, Slack
│ ├── assistant/ # Notes, todos, web, fs/git tools
│ ├── memory/ # Structured storage with semantic search
│ ├── scheduler/ # Task scheduling and delivery
│ ├── cli/ # Click-based CLI
│ ├── ui/ # TUI dashboard
│ ├── skills/ # Hot-reloadable skill plugins
│ └── governance/ # Anomaly voting, consensus
├── tests/
│ ├── unit/ # Component tests
│ ├── integration/ # Cross-component runtime flows
│ ├── behavioral/ # Product-correctness gate
│ └── adversarial/ # Prompt injection, exfil, evasion
├── runner/ # Dev harness (tmux, env isolation, policy bootstrap)
├── scripts/ # Validation, coverage, asset checks
├── docs/ # Design docs, ADRs, runbooks, analysis
└── examples/ # Example configs and skills
Key runtime paths:
- Policy enforcement:
src/shisad/security/pep.py - Egress proxy:
src/shisad/executors/proxy.py - Handler implementation:
src/shisad/daemon/handlers/_impl.py(composed from_impl_session.py,_impl_tool_execution.py,_impl_memory.py, etc.)
Development
uv run ruff check src/ tests/ scripts/
uv run mypy src/shisad/
uv run pytest -q
See AGENTS.md for full development process, validation matrix, and commit conventions.
Documentation
| Doc | Description |
|---|---|
docs/DESIGN-PHILOSOPHY.md |
First-principles reference — read this first |
docs/DEPLOY.md |
Public bring-up and deployment quickstart |
docs/SECURITY.md |
Security architecture — threat model, enforcement layers, trust boundaries |
docs/ROADMAP.md |
Public roadmap and milestone direction |
docs/USE-CASES.md |
Prioritized use cases and capability mapping |
docs/ENV-VARS.md |
Environment variable reference |
docs/TOOL-STATUS.md |
Current tool surface snapshot |
docs/adr/ |
Architectural decision records |
docs/analysis/ |
Security case studies and supply chain analysis |
docs/runbooks/ |
Operator runbooks (browser setup, incident response, key rotation, rollback, skill revocation) |
runner/RUNBOOK.md |
Dev harness operator runbook |
- agentic-security — literature survey on LLM agent security (78 papers, defense taxonomy, production readiness assessment)
- agentic-memory — literature survey on agent memory architectures and poisoning defenses (29+ references, attack taxonomy, defense recommendations)
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shisad-0.7.3.1.tar.gz.
File metadata
- Download URL: shisad-0.7.3.1.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
905ed7b77fb115e79f4e2a6ebc0f32e4b381166ae2ec002fc6a87c7f97e45bad
|
|
| MD5 |
be200ad6a6138113a6b6257b664c6827
|
|
| BLAKE2b-256 |
15aca18f7a8cdb2f5542188643e10e7f9f8fea00d4c5fd32ff4d73d44b770f11
|
Provenance
The following attestation bundles were made for shisad-0.7.3.1.tar.gz:
Publisher:
publish.yml on shisa-ai/shisad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shisad-0.7.3.1.tar.gz -
Subject digest:
905ed7b77fb115e79f4e2a6ebc0f32e4b381166ae2ec002fc6a87c7f97e45bad - Sigstore transparency entry: 1555454392
- Sigstore integration time:
-
Permalink:
shisa-ai/shisad@cb483627a9d8ad38b1a273709f6253a84f46d3c7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shisa-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb483627a9d8ad38b1a273709f6253a84f46d3c7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file shisad-0.7.3.1-py3-none-any.whl.
File metadata
- Download URL: shisad-0.7.3.1-py3-none-any.whl
- Upload date:
- Size: 816.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45547c0c45e918f2de153d4278320cae4b1c6c2838e0f6395e6c2c93eda9aac5
|
|
| MD5 |
55b12019671320c3e4fcf9287533df53
|
|
| BLAKE2b-256 |
c426201f710c2597c9ac794ebb6bf294cdcaca0dab4044b0afa2b876509d8522
|
Provenance
The following attestation bundles were made for shisad-0.7.3.1-py3-none-any.whl:
Publisher:
publish.yml on shisa-ai/shisad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shisad-0.7.3.1-py3-none-any.whl -
Subject digest:
45547c0c45e918f2de153d4278320cae4b1c6c2838e0f6395e6c2c93eda9aac5 - Sigstore transparency entry: 1555454406
- Sigstore integration time:
-
Permalink:
shisa-ai/shisad@cb483627a9d8ad38b1a273709f6253a84f46d3c7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shisa-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb483627a9d8ad38b1a273709f6253a84f46d3c7 -
Trigger Event:
workflow_dispatch
-
Statement type: