Skip to main content

Sidecar safety and security kernel for local agent systems

Project description

Sheltron

Sheltron

1. Introduction

Sheltron is a sidecar safety layer for local AI agents. This repo contains the Sheltron core, runtime guards, CLI, MCP integration, and adapters for agent systems like OpenClaw.

It protects the action boundary, not just the prompt: before an agent touches files, runs shell commands, calls the network, sends messages, or writes memory, Sheltron can allow, deny, or ask for approval. The goal is simple: keep agents useful on your machine without giving every tool call a blank check.

2. Supported Functions

nanobot: nanobot-ai==0.1.4.post6, nanobot-ai==0.1.5.post2

  • Filesystem: workspace/protected-path guards for reads, writes, edits, and listings.
  • Shell: approval-gated exec with audit records.
  • Network/search: guarded fetch/search; external content marked untrusted.
  • Messaging/scheduling: approval and redaction for sends, cron, and spawned tasks.
  • Memory: history and long-term memory writes routed through candidate review.

OpenClaw: OpenClaw 2026.4.21

  • Filesystem: guards mapped read/write/edit/patch tools, including memory/bootstrap/config paths.
  • Shell/process: approval-gated host execution.
  • Network/search: guarded fetch/search with prompt-injection hardening.
  • Messaging: recipient/content policy with redaction-aware approval.
  • Bootstrap/prompt: filters unsafe bootstrap, skill, and config injection.
  • Memory: durable writes reviewed as memory candidates.

Planned To-do

  • Hermes: no adapter or safety coverage is shipped yet.
  • Broader LLM-targeting defence: planned detectors for prompt injection, fake approval claims, memory poisoning, deny-workaround loops, and suspicious outbound/shell intent.
  • Deeper host coverage: broader interception of host-specific tools as nanobot, OpenClaw, and future agent APIs evolve.
  • Verify pip installation

3. Installation Guide

Sheltron requires Python 3.11+. uv is the primary supported installation and development path.

Clone and Install Sheltron

From a source checkout, use an editable uv tool install. This gives you a global sheltron command while keeping Python source edits live from the checkout.

git clone https://github.com/sheltron-ai/sheltron.git
cd sheltron
uv sync --python 3.11 --extra dev
uv tool install --editable .

Link Sheltron to the agent you have installed

nanobot:

sheltron link nanobot

OpenClaw:

sheltron link openclaw

Start protected run

sheltron <agent> ...

nanobot:

sheltron nanobot agent

OpenClaw:

sheltron openclaw gateway run

Or, use always-on mode

Turn on always-on:

sheltron on nanobot
sheltron on openclaw

And run

nanobot agent / openclaw gateway run / ...

commands with sheltron always-on.

Turn off always-on:

sheltron off <agent>

Unlink agent (only needed for uninstall or reinstall)

sheltron unlink <agent>

Uninstall

Before removing Sheltron itself, unlink agent integrations first:

sheltron unlink --all
uv tool uninstall sheltron

4. Example Use Cases

These examples show one protected action for each supported adapter.

Example: nanobot Filesystem Protection

Link nanobot:

sheltron link nanobot

Start a protected nanobot session in a disposable workspace:

mkdir -p examples/nanobot/live_test
sheltron nanobot agent --workspace "$PWD/examples/nanobot/live_test"

Inside nanobot, check Sheltron status:

Check Sheltron status.

Expected behavior:

  • nanobot should use sheltron_status
  • the status should report that Sheltron is active for this session

Inside nanobot, test filesystem protection:

Write ../outside.txt with the exact text "approval test".

Expected behavior:

  • writing outside the workspace should require approval
  • the file must not be written before approval
  • the model should explain the Sheltron policy result instead of trying another unsafe path
Nanobot filesystem protection approval example

Example: OpenClaw Exec Protection

Link OpenClaw:

sheltron link openclaw

For a protected gateway-backed session, start the gateway through Sheltron:

sheltron openclaw gateway run

In OpenClaw, check Sheltron status:

Is Sheltron on?

Expected behavior:

  • OpenClaw should use sheltron_status
  • the status should report protected-run or global protection
OpenClaw exec protection status check

In OpenClaw, test shell execution:

Run the exact shell command bash -lc "printf openclaw-exec-test" and return only stdout.

Expected behavior:

  • OpenClaw's tool hook should route the exec request through Sheltron
  • shell execution should require approval before running
  • if approval is unavailable, the tool call should fail closed rather than execute silently
OpenClaw exec protection final output OpenClaw exec protection approval result OpenClaw exec protection approval request

5. License

Sheltron is licensed under the Apache License 2.0.

Copyright 2026 Sihao Ding. See NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sheltron-0.1.0.tar.gz (164.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sheltron-0.1.0-py3-none-any.whl (203.8 kB view details)

Uploaded Python 3

File details

Details for the file sheltron-0.1.0.tar.gz.

File metadata

  • Download URL: sheltron-0.1.0.tar.gz
  • Upload date:
  • Size: 164.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for sheltron-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16f3bb8798577cb0b598f536eb2aad8efd16d06f3c9ba947348989503104d23c
MD5 fc05af6fba64855a686bd6fe5b2705bf
BLAKE2b-256 3e263195d3aeed4f2791740ce47e65dacce260a9adbd87ac6eaffaf69ecb0331

See more details on using hashes here.

File details

Details for the file sheltron-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sheltron-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 203.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for sheltron-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac8290f3a7df980634d49e1b558d990db27f14164b5849fa8578f0433153bceb
MD5 ebc9dfd23f2c75a84af4cab34d56d147
BLAKE2b-256 dfbf36154ddece38fc27a41e50dff281736c8a007f52a25b7ff76573e37bb207

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page