Skip to content

Your own personal *secure* AI assistant. Any OS. Any Platform. The lobster way. 🦞

License

Notifications You must be signed in to change notification settings

PredicateSystems/secureclaw

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15,310 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SecureClaw β€” Zero-Trust Security for AI Agents

SecureClaw

Pre-authorization. Post-verification. Zero-trust AI agent security.
Read the Security Architecture β†’

CI status GitHub release npm version MIT License

Authorization β‰  Intent

Identity and token authorization are solved problems in traditional software engineering. But in the era of autonomous AI agents, standard RBAC is not enough. Just because an agent holds a valid API token to execute a command doesn't mean its current intent is safe.

If an agent hallucinates, experiences context compaction, or falls victim to prompt injection, your standard authorization system blindly complies with the malicious intent.

SecureClaw is an enterprise-hardened fork of the popular OpenClaw framework. It replaces probabilistic "LLM-as-a-judge" safety measures with a deterministic, Zero-Trust execution harness.

The Security Harness

SecureClaw wraps the standard OpenClaw execution loop with an embedded Rust sidecar (predicate-authorityd) that enforces safety in two places:

  1. Pre-Execution Gate (The Gate): Before the orchestrator executes an action (e.g., a bash command or browser click), it is intercepted and evaluated against a local, fail-closed JSON policy. It blocks rogue intents in <1ms before the OS even sees them.
  2. Post-Execution Verification (The Math): SecureClaw uses deterministic math based on state changes (e.g., url_contains('example.com')) to instantly evaluate if an action succeeded, completely eliminating hallucination risks in the validation step.

Website Β· Security Docs Β· Policies Directory Β· Discord


Install

SecureClaw requires Node β‰₯22 and is distributed under the official Predicate Systems NPM scope to guarantee supply-chain integrity.

# Install via the official scoped package
npm install -g @predicatesystems/secureclaw@latest
# or: pnpm add -g @predicatesystems/secureclaw@latest

# Initialize with strict security defaults
secureclaw onboard --install-daemon --strict-mode

Quick Start (Secure Loop)

By default, SecureClaw runs in a walled garden. You must define explicit permissions in your local policy files.

# Start the Gateway with the Rust interceptor enabled
secureclaw gateway --port 18789 --policy-file policies/strict.json --verbose

# Send an intent to the agent
secureclaw agent --message "Read the ssh config" --thinking high

# If the policy does not explicitly allow fs.read on ~/.ssh, it will be hard-blocked in <1ms.

Plug-and-Play Policies

SecureClaw ships with four ready-to-use policy templates in the policies/ directory. Pick the one that matches your security posture:

Policy Use Case What It Does
strict.json Production default Workspace-isolated writes, blocks sensitive files (.env, .ssh/), allows safe shell commands and HTTPS. Start here.
strict-web-only.json Browser automation Zero local access. Blocks ALL filesystem and shell. Only allows HTTPS navigation to allowlisted domains.
read-only-local.json Code review agents Read anywhere, write nowhere. Allows cat, grep, git status but blocks rm, git push, writes.
audit-only.json Agent profiling Allows everything (except catastrophic commands) with full logging. Use to learn what policies you need.

Example: Deploying a Read-Only Code Reviewer

secureclaw gateway --port 18789 --policy-file policies/read-only-local.json

Example: Locked-Down Browser Bot

secureclaw gateway --port 18789 --policy-file policies/strict-web-only.json

Creating Custom Policies

  1. Start with audit-only.json to observe what your agent actually does
  2. Review the authorization logs to see requested actions
  3. Copy the closest template and customize the rules
  4. See policies/README.md for the full schema reference

Upstream OpenClaw Integrations

SecureClaw inherits the massive, highly flexible integration ecosystem of upstream OpenClaw, allowing you to deploy secure agents across any surface.

  • Multi-channel Inbox: Connect to WhatsApp, Telegram, Slack, Discord, Microsoft Teams, Signal, and Matrix.
  • First-Class Tools: Native browser control (via Sentience DOM pruning), system cron, macOS Canvas, and iOS/Android nodes.
  • Remote Gateway Operations: Run your agent safely on headless Linux servers while maintaining remote access via Tailscale Serve/Funnel or SSH tunnels.

(For full channel setup instructions, see the Upstream Integration Guides)

Sponsors

OpenAI Blacksmith
OpenAI Blacksmith

Highlights

  • Local-first Gateway β€” single control plane for sessions, channels, tools, and events.
  • Multi-channel inbox β€” WhatsApp, Telegram, Slack, Discord, Google Chat, Signal, BlueBubbles (iMessage), iMessage (legacy), Microsoft Teams, Matrix, Zalo, Zalo Personal, WebChat, macOS, iOS/Android.
  • Multi-agent routing β€” route inbound channels/accounts/peers to isolated agents (workspaces + per-agent sessions).
  • Voice Wake + Talk Mode β€” always-on speech for macOS/iOS/Android with ElevenLabs.
  • Live Canvas β€” agent-driven visual workspace with A2UI.
  • First-class tools β€” browser, canvas, nodes, cron, sessions, and Discord/Slack actions.
  • Companion apps β€” macOS menu bar app + iOS/Android nodes.
  • Onboarding + skills β€” wizard-driven setup with bundled/managed/workspace skills.

Star History

Star History Chart

Everything we built so far

Core platform

Channels

Apps + nodes

Tools + automation

Runtime + safety

Ops + packaging

How it works (short)

WhatsApp / Telegram / Slack / Discord / Google Chat / Signal / iMessage / BlueBubbles / Microsoft Teams / Matrix / Zalo / Zalo Personal / WebChat
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Gateway            β”‚
β”‚       (control plane)         β”‚
β”‚     ws://127.0.0.1:18789      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β”œβ”€ Pi agent (RPC)
               β”œβ”€ CLI (openclaw …)
               β”œβ”€ WebChat UI
               β”œβ”€ macOS app
               └─ iOS / Android nodes

Key subsystems

Tailscale access (Gateway dashboard)

SecureClaw can auto-configure Tailscale Serve (tailnet-only) or Funnel (public) while the Gateway stays bound to loopback. Configure gateway.tailscale.mode:

  • off: no Tailscale automation (default).
  • serve: tailnet-only HTTPS via tailscale serve (uses Tailscale identity headers by default).
  • funnel: public HTTPS via tailscale funnel (requires shared password auth).

Notes:

  • gateway.bind must stay loopback when Serve/Funnel is enabled (SecureClaw enforces this).
  • Serve can be forced to require a password by setting gateway.auth.mode: "password" or gateway.auth.allowTailscale: false.
  • Funnel refuses to start unless gateway.auth.mode: "password" is set.
  • Optional: gateway.tailscale.resetOnExit to undo Serve/Funnel on shutdown.

Details: Tailscale guide Β· Web surfaces

Remote Gateway (Linux is great)

It’s perfectly fine to run the Gateway on a small Linux instance. Clients (macOS app, CLI, WebChat) can connect over Tailscale Serve/Funnel or SSH tunnels, and you can still pair device nodes (macOS/iOS/Android) to execute device‑local actions when needed.

  • Gateway host runs the exec tool and channel connections by default.
  • Device nodes run device‑local actions (system.run, camera, screen recording, notifications) via node.invoke. In short: exec runs where the Gateway lives; device actions run where the device lives.

Details: Remote access Β· Nodes Β· Security

macOS permissions via the Gateway protocol

The macOS app can run in node mode and advertises its capabilities + permission map over the Gateway WebSocket (node.list / node.describe). Clients can then execute local actions via node.invoke:

  • system.run runs a local command and returns stdout/stderr/exit code; set needsScreenRecording: true to require screen-recording permission (otherwise you’ll get PERMISSION_MISSING).
  • system.notify posts a user notification and fails if notifications are denied.
  • canvas.*, camera.*, screen.record, and location.get are also routed via node.invoke and follow TCC permission status.

Elevated bash (host permissions) is separate from macOS TCC:

  • Use /elevated on|off to toggle per‑session elevated access when enabled + allowlisted.
  • Gateway persists the per‑session toggle via sessions.patch (WS method) alongside thinkingLevel, verboseLevel, model, sendPolicy, and groupActivation.

Details: Nodes Β· macOS app Β· Gateway protocol

Agent to Agent (sessions_* tools)

  • Use these to coordinate work across sessions without jumping between chat surfaces.
  • sessions_list β€” discover active sessions (agents) and their metadata.
  • sessions_history β€” fetch transcript logs for a session.
  • sessions_send β€” message another session; optional reply‑back ping‑pong + announce step (REPLY_SKIP, ANNOUNCE_SKIP).

Details: Session tools

Skills registry (ClawHub)

ClawHub is a minimal skill registry. With ClawHub enabled, the agent can search for skills automatically and pull in new ones as needed.

ClawHub

Chat commands

Send these in WhatsApp/Telegram/Slack/Google Chat/Microsoft Teams/WebChat (group commands are owner-only):

  • /status β€” compact session status (model + tokens, cost when available)
  • /new or /reset β€” reset the session
  • /compact β€” compact session context (summary)
  • /think <level> β€” off|minimal|low|medium|high|xhigh (GPT-5.2 + Codex models only)
  • /verbose on|off
  • /usage off|tokens|full β€” per-response usage footer
  • /restart β€” restart the gateway (owner-only in groups)
  • /activation mention|always β€” group activation toggle (groups only)

Apps (optional)

The Gateway alone delivers a great experience. All apps are optional and add extra features.

If you plan to build/run companion apps, follow the platform runbooks below.

macOS (SecureClaw.app) (optional)

  • Menu bar control for the Gateway and health.
  • Voice Wake + push-to-talk overlay.
  • WebChat + debug tools.
  • Remote gateway control over SSH.

Note: signed builds required for macOS permissions to stick across rebuilds (see docs/mac/permissions.md).

iOS node (optional)

  • Pairs as a node via the Bridge.
  • Voice trigger forwarding + Canvas surface.
  • Controlled via openclaw nodes ….

Runbook: iOS connect.

Android node (optional)

  • Pairs via the same Bridge + pairing flow as iOS.
  • Exposes Canvas, Camera, and Screen capture commands.
  • Runbook: Android connect.

Agent workspace + skills

  • Workspace root: ~/.openclaw/workspace (configurable via agents.defaults.workspace).
  • Injected prompt files: AGENTS.md, SOUL.md, TOOLS.md.
  • Skills: ~/.openclaw/workspace/skills/<skill>/SKILL.md.

Configuration

Minimal ~/.openclaw/openclaw.json (model + defaults):

{
  agent: {
    model: "anthropic/claude-opus-4-6",
  },
}

Full configuration reference (all keys + examples).

Security model (important)

  • Default: tools run on the host for the main session, so the agent has full access when it’s just you.
  • Group/channel safety: set agents.defaults.sandbox.mode: "non-main" to run non‑main sessions (groups/channels) inside per‑session Docker sandboxes; bash then runs in Docker for those sessions.
  • Sandbox defaults: allowlist bash, process, read, write, edit, sessions_list, sessions_history, sessions_send, sessions_spawn; denylist browser, canvas, nodes, cron, discord, gateway.

Details: Security guide Β· Docker + sandboxing Β· Sandbox config

  • Link the device: pnpm openclaw channels login (stores creds in ~/.openclaw/credentials).
  • Allowlist who can talk to the assistant via channels.whatsapp.allowFrom.
  • If channels.whatsapp.groups is set, it becomes a group allowlist; include "*" to allow all.
  • Set TELEGRAM_BOT_TOKEN or channels.telegram.botToken (env wins).
  • Optional: set channels.telegram.groups (with channels.telegram.groups."*".requireMention); when set, it is a group allowlist (include "*" to allow all). Also channels.telegram.allowFrom or channels.telegram.webhookUrl + channels.telegram.webhookSecret as needed.
{
  channels: {
    telegram: {
      botToken: "123456:ABCDEF",
    },
  },
}
  • Set SLACK_BOT_TOKEN + SLACK_APP_TOKEN (or channels.slack.botToken + channels.slack.appToken).
  • Set DISCORD_BOT_TOKEN or channels.discord.token (env wins).
  • Optional: set commands.native, commands.text, or commands.useAccessGroups, plus channels.discord.allowFrom, channels.discord.guilds, or channels.discord.mediaMaxMb as needed.
{
  channels: {
    discord: {
      token: "1234abcd",
    },
  },
}
  • Requires signal-cli and a channels.signal config section.
  • Recommended iMessage integration.
  • Configure channels.bluebubbles.serverUrl + channels.bluebubbles.password and a webhook (channels.bluebubbles.webhookPath).
  • The BlueBubbles server runs on macOS; the Gateway can run on macOS or elsewhere.
  • Legacy macOS-only integration via imsg (Messages must be signed in).
  • If channels.imessage.groups is set, it becomes a group allowlist; include "*" to allow all.
  • Configure a Teams app + Bot Framework, then add a msteams config section.
  • Allowlist who can talk via msteams.allowFrom; group access via msteams.groupAllowFrom or msteams.groupPolicy: "open".
  • Uses the Gateway WebSocket; no separate WebChat port/config.

Browser control (optional):

{
  browser: {
    enabled: true,
    color: "#FF4500",
  },
}

Docs

Use these when you’re past the onboarding flow and want the deeper reference.

Advanced docs (discovery + control)

Operations & troubleshooting

Deep dives

Workspace & skills

Platform internals

Email hooks (Gmail)

Molty

SecureClaw was built for Molty, a space lobster AI assistant. 🦞 by Peter Steinberger and the community.

Community

See CONTRIBUTING.md for guidelines, maintainers, and how to submit PRs. AI/vibe-coded PRs welcome! πŸ€–

Special thanks to Mario Zechner for his support and for pi-mono. Special thanks to Adam Doppelt for lobster.bot.

Thanks to all clawtributors:

steipete sktbrd cpojer joshp123 Mariano Belinky Takhoffman sebslight tyler6204 quotentiroler Verite Igiraneza gumadeiras bohdanpodvirnyi vincentkoc iHildy jaydenfyi Glucksberg joaohlisboa rodrigouroz mneves75 BunsDev MatthieuBizien MaudeBot vignesh07 smartprogrammer93 advaitpaliwal HenryLoenwind rahthakor vrknetha abdelsfane radek-paclt joshavant christianklotz mudrii zerone0x ranausmanai Tobias Bischoff heyhudson czekaj ethanpalm yinghaosang nabbilkhan mukhtharcm aether-ai-agent coygeek Mrseenz maxsumrall xadenryan VACInc juanpablodlc conroywhitney Harald Buerbaumer akoscz Bridgerz hsrvc magimetal openclaw-bot meaningfool JustasM Phineas1500 ENCHIGO Hiren Patel NicholasSpisak claude jonisjongithub theonejvo abhisekbasu1 Ryan Haines Blakeshannon jamesgroat Marvae arosstale shakkernerd gejifeng divanoli ryan-crabbe nyanjou Sam Padilla dantelex SocialNerd42069 solstead natefikru daveonkels LeftX Yida-Dev Masataka Shinohara Lewis riccardogiorato lc0rp adam91holt mousberg BillChirico shadril238 CharlieGreenman hougangdev Mars orlyjamie McRolly NWANGWU LI SHANXIN Simone Macario durenzidu JustYannicc Minidoracat magendary Jessy LANGE mteam88 brandonwise hirefrank M00N7682 dbhurley Eng. Juan Combetto Harrington-bot TSavo Lalit Singh julianengel Jay Caldwell Kirill Shchetynin nachx639 bradleypriest TsekaLuk benithors Shailesh thewilloftheshadow jackheuberger loiie45e El-Fitz benostein pvtclawn 0xRaini ruypang xinhuagu Taylor Asplund adhitShet Paul van Oorschot sreekaransrinath buddyh gupsammy AI-Reviewer-QS Stefan Galescu WalterSumbon nachoiacovino rodbland2021 Vasanth Rao Naik Sabavat fagemx petter-b omair445 dorukardahan leszekszpunar Clawborn davidrudduck scald Igor Markelov rrenamed Parker Todd Brooks AnonO6 Tanwa Arpornthip andranik-sahakyan davidguttman sleontenko denysvitali Tom Ron popomore Patrick Barletta shayan919293 δΈεšδΊ†η‘ε€§θ§‰ Luis Conde Harry Cui Kepler SidQin-cyber Lucky Michael Lee sircrumpet peschee dakshaymehta davidiach nonggia.liang seheepeak obviyus danielwanwx osolmaz minupla misterdas Shuai-DaiDai dominicnunez lploc94 sfo2001 lutr0 dirbalak cathrynlavery Joly0 kiranjd niceysam danielz1z Iranb carrotRakko Oceanswave cdorsey AdeboyeDN j2h4u Alg0rix Skyler Miao peetzweg/ TideFinder CornBrother0x DukeDeSouth emanuelst bsormagec Diaspar4u evanotero Nate OscarMinjarez webvijayi garnetlyx miloudbelarebia Jeremiah Lowin liebertar Max rhuanssauro joshrad-dev adityashaw2 CashWilliams taw0002 asklee-klawd h0tp-ftw constansino mcaxtr onutc ryan unisone artuskg Solvely-Colin pahdo Kimitaka Watanabe Lilo Rajat Joshi Yuting Lin Neo wu-tian807 ngutman crimeacs manuelhettich mcinteerj bjesuiter Manik Vahsith alexgleason Nicholas Stephen Brian King justinhuangcode mahanandhi andreesg connorshea dinakars777 Flash-LHR JINNYEONG KIM Protocol Zero kyleok Limitless grp06 robbyczgw-cla slonce70 JayMishra-source ide-rea lailoo badlogic echoVic amitbiswal007 azade-c John Rood dddabtc Jonathan Works roshanasingh4 tosh-hamburg dlauer ezhikkk Shivam Kumar Raut Mykyta Bozhenko YuriNachos Josh Phillips ThomsenDrake Wangnov akramcodez jadilson12 Whoaa512 clawdinator[bot] emonty kaizen403 chriseidhof Lukavyi wangai-studio ysqander aj47 google-labs-jules[bot] hyf0-agent Jeremy Mumford Kenny Lee superman32432432 widingmarcus-cyber DylanWoodAkers antons austinm911 boris721 damoahdominic dan-dr doodlewind GHesericsu HeimdallStrategy imfing jalehman jarvis-medmatic kkarimi mahmoudashraf93 pkrmf Randy Torres sumleo Yeom-JinHo akyourowngames aldoeliacim Dithilli dougvk erikpr1994 fal3 jonasjancarik koala73 mitschabaude-bot mkbehr Oren shtse8 sibbl thesomewhatyou zats chrisrodz frankekn gabriel-trigo ghsmc iamadig ibrahimq21 irtiq7 jeann2013 jogelin Jonathan D. Rhyne (DJ-D) Justin Ling kelvinCB manmal Matthew MattQ Milofax mitsuhiko neist pejmanjohn ProspectOre rmorse rubyrunsstuff rybnikov santiagomed Steve (SecureClaw) suminhthanh svkozak wes-davis 24601 AkashKobal ameno- awkoy battman21 BinHPdev bonald dashed dawondyifraw dguido Django Navarro evalexpr henrino3 humanwritten hyojin joeykrug larlyssa liuy Mark Liu natedenh odysseus0 pcty-nextgen-service-account pi0 Syhids tmchow uli-will-code aaronveklabs andreabadesso BinaryMuse cash-echo-bot CJWTRUST cordx56 danballance Elarwei001 EnzeD erik-agens Evizero fcatuhe gildo Grynn huntharo hydro13 itsjaydesu ivanrvpereira jverdi kentaro loeclos longmaba MarvinCui MisterGuy420 mjrussell odnxe optimikelabs oswalpalash p6l-richard philipp-spiess RamiNoodle733 Raymond Berger Rob Axelsen sauerdaniel SleuthCo T5-AndyML TaKO8Ki thejhinvirtuoso travisp yudshj zknicker 0oAstro 8BlT Abdul535 abhaymundhara aduk059 afurm aisling404 akari-musubi Alex-Alaniz alexanderatallah alexstyl andrewting19 araa47 Asleep123 Ayush10 bennewton999 bguidolim caelum0x championswimmer Chloe-VP dario-github DarwinsBuddy David-Marsh-Photo dcantu96 dndodson dvrshil dxd5001 dylanneve1 EmberCF ephraimm ereid7 eternauta1337 foeken gtsifrikas HazAT iamEvanYT ikari-pl kesor knocte MackDing nobrainer-tech Noctivoro Olshansk Pratham Dubey Raikan10 SecondThread Swader testingabc321 0xJonHoldsCrypto aaronn Alphonse-arianee atalovesyou carlulsoe hrdwdmrbl hugobarauna jayhickey jiulingyun kitze latitudeki5223 loukotal minghinmatthewlam MSch odrobnik rafaelreis-r ratulsarna reeltimeapps rhjoh ronak-guliani snopoke thesash timkrase

About

Your own personal *secure* AI assistant. Any OS. Any Platform. The lobster way. 🦞

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 85.7%
  • Swift 10.0%
  • Kotlin 1.9%
  • Shell 0.8%
  • JavaScript 0.7%
  • CSS 0.4%
  • Other 0.5%