SafeClaw is an OpenClaw agent with access to Protopia SGT to expand the usability of sensitive data for AI with state-of-the-art data protection and privacy.
SafeClaw does not replace your existing OpenClaw agents, it provides an alternative for using your AI assistant with sensitive information. With SafeClaw, information never leaves your workspace as plaintext and cannot be recovered from the protected embeddings.
π‘ Request access to Protopia SGT from https://protopia.ai/safeclaw/
- π Requirements
- βοΈ Setup
- Setup OpenClaw Browsing Tool
- Example 1: (Financial Data π Using the Chat Interface).
- Example 2 (Portfolio Monitoring Agent β±οΈ Using cron job).
- Example 3 (βοΈ Email scanning/report).
- Example 4 (π PII Scanner).
- Data Sources Integration
- Protopia Stained Glass Proxy (SGP) docker image (v1.49.2 or above).
- SGT model (e.g
Protopia/SGT-for-Qwen3-32B-swept-water-bfloat16).
π‘ Request access to a Protopia SGT from https://protopia.ai/safeclaw/
- Modal deployment script and Modal API keys (or any other way to host the upstream
Qwen3-32Bfor inference.) - docker-compose file.
- openclaw.json starter configuration.
- Demo Resources and Data
- Example Cron Tasks Scripts
-
π³ Build custom
OpenClawdocker image:# Build demo image from custom Dockerfile docker build -t ghcr.io/openclaw/openclaw:protopia-demo .
-
Copy
openclaw.jsonto your local OpenClaw config directory:cp openclaw.json ~/.openclaw/openclaw.jsonThe file uses
${VAR}placeholders for all secrets. The container expands them at startup using env vars passed by docker-compose (see step 4).β οΈ Important: This will replace your existing~/.openclaw/openclaw.json. Back it up first if needed. -
Deploy upstream LLM to Modal with the Modal Deployment Script (or any other inference service of your choice).
# for a Modal deployment: uv pip install modal MODAL_LOG_LEVEL=DEBUG modal deploy scripts/modal_deploy_output_protection.pyβ οΈ Important: The modal deploy script loads theOUTPUT_PROTECTION_IMAGEfrom AWS ECR. Update this as needed. Other options here.β οΈ Important: The Modal deployment script loads theQwen/Qwen3-32Bmodel from Hugging Face. Ensure your Modalhuggingface-secretis configured with a valid HF token. This token may differ from the HF token used for SGT model access.- Update the docker-compose
stainedglassservice with your modal API keys to ensure SGT proxy can communicate with upstream Modal.
π‘ Hint: Set env variable:
SGP_REQUEST_HEADERS_TO_ADD: "Modal-Key=[your-key],Modal-Secret=[your-secret]"in the docker-composestainedglassservice. - Update the docker-compose
-
Set your credentials and run with
docker compose. The easiest way is a.envfile in the project root:# .env HF_TOKEN=... # HF token with access to the Qwen32B SGT model (provided by Protopia) MODAL_KEY=... # Modal API key (for upstream inference) MODAL_SECRET=... # Modal API secret SGT_API_KEY=... # SGT proxy API key (provided by Protopia) SLACK_BOT_TOKEN=... # xoxb-... (required for examples 2, 3, 4) SLACK_APP_TOKEN=... # xapp-... (required for examples 2, 3, 4) BRAVE_API_KEY=... # Required for example 2 (portfolio monitor web search) GOG_KEYRING_PASSWORD=safeclaw # Use 'safeclaw' for the demo Gmail account
Then start:
docker compose -f deploy/compose/docker-compose.yaml up -d
-
π Verify running containers:
docker ps # > you should have at least these containers running: ghcr.io/openclaw/openclaw:protopia-demo stainedglass-proxy -
Register the
SafeClawOpenClaw agentdocker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw agents add safeclaw- This will update your
~/.openclaw/openclaw.jsonwith your newSafeClawagent.
- This will update your
-
Access OpenClaw Chat UI at
localhost:18790/chat?token=[your token](setup port-forward if needed).π‘ Hint: You can find the
tokenat~/.openclaw/openclaw.jsonunderauth. -
β οΈ If you get apairing requirederror, then you need to allow your device in Openclaw, follow these steps:# List pending requests docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw devices list
- Find devices listed under
Pendingand copy its request id.
# Approve by request ID docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw devices approve [request-id]
- Test accessing the OpenClaw Web UI again, or connect to the OpenClaw
TUI:
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw tui - Find devices listed under
- You will need a Brave API key. Get one from https://api-dashboard.search.brave.com
- Run:
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw configure --section weband follow the instructions. - Ask OpenClaw to perform a search for you!
User uses the OpenClaw chat interface to work on financial data analysis.
- The demo data is automatically seeded to
~/.openclaw/workspace-safeclaw/financial-data/when the container first starts.
OpenClaw agent scheduled task to generate a report based on local portfolio data and web search. The resulting report is posted on Slack.
- The demo data and task instructions are automatically seeded to
~/.openclaw/workspace-safeclaw/investment-portfolio/when the container first starts.
- Follow the steps here: (https://docs.openclaw.ai/channels/slack)
{
"display_information": {
"name": "SafeClaw",
"description": "OpenClaw with SGT Protection",
"background_color": "#737373"
},
"features": {
"app_home": {
"home_tab_enabled": false,
"messages_tab_enabled": true,
"messages_tab_read_only_enabled": false
},
"bot_user": {
"display_name": "SafeClaw",
"always_online": false
},
"slash_commands": [
{
"command": "/safeclaw",
"description": "Send a message to OpenClaw",
"should_escape": false
}
]
},
"oauth_config": {
"scopes": {
"bot": [
"chat:write",
"channels:history",
"channels:read",
"groups:history",
"im:history",
"im:read",
"im:write",
"mpim:history",
"mpim:read",
"mpim:write",
"users:read",
"app_mentions:read",
"assistant:write",
"reactions:read",
"reactions:write",
"pins:read",
"pins:write",
"emoji:read",
"commands",
"files:read",
"files:write"
]
}
},
"settings": {
"event_subscriptions": {
"bot_events": [
"app_mention",
"message.channels",
"message.groups",
"message.im",
"message.mpim",
"reaction_added",
"reaction_removed",
"member_joined_channel",
"member_left_channel",
"channel_rename",
"pin_added",
"pin_removed"
]
},
"interactivity": {
"is_enabled": true
},
"org_deploy_enabled": false,
"socket_mode_enabled": true,
"token_rotation_enabled": false
}
}# Test Slack integration
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw channels status --probe- Register the
portfolio_monitorOpenClaw cron task:
# Register job.
docker compose -f deploy/compose/docker-compose.yaml exec -T openclaw-gateway sh < cron/portfolio_monitor.sh
# Verify job.
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron list
# Test run job.
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron run [job-id]Sends a report to Slack each day with a list of action items based on new emails.
-
Follow the steps to setup OpenClaw Gmail Integration.
-
Follow the steps to setup Slack Integration.
-
The demo data and task instructions are automatically seeded to
~/.openclaw/workspace-safeclaw/email-monitor/when the container first starts. -
Register the
email_monitorOpenClaw cron task:π‘ Update ./cron/email_monitor.sh with your SLACK-CHANNEL-ID.
# Register job. docker compose -f deploy/compose/docker-compose.yaml exec -T openclaw-gateway sh < cron/email_monitor.sh # Verify job. docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron list # Test run job. docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron run [job-id]
Sorts and sends a report to slack when files are uploaded to a local directory, stating whether the files contained PII.
- Follow the steps to setup Slack Integration.
- The demo data, task instructions, and sort directories (
pending/,no-pii/,yes-pii/) are automatically seeded to~/.openclaw/workspace-safeclaw/pii-scanner/when the container first starts. - Register the
pii_scannerOpenClaw cron task:π‘ Update ./cron/pii_scanner.sh with your SLACK-CHANNEL-ID.
# Register job. docker compose -f deploy/compose/docker-compose.yaml exec -T openclaw-gateway sh < cron/pii_scanner.sh # Verify job. docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron list # Test run job. docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway openclaw cron run [job-id]
π‘ OpenClaw gateway can expose a small HTTP webhook endpoint for external triggers.
β οΈ We strongly recommend the use a dedicated demo Gmail account, not a personal or work account.β οΈ
- The OpenClaw Dockerfile provided includes all the dependencies needed to run with the Gmail integration:
gogcligoogle-cloud-sdk
-
Setup and login to
gcloud. Follow instructions to create a new project and setup Billing. You need a Google Cloud account to create the OAuth client credentials. -
You need an OAuth client secret JSON. Here's how to get it:
- Go to Google Cloud Console β APIs & Services β Credentials
- Click Create Credentials β OAuth Client ID
- Set application type to Desktop app (required for gcloud auth flows)
- Click Create, then Download JSON
# copy client credentials to OpenClaw workspace
mkdir -p ~/.openclaw/workspace-safeclaw/google && cp [your-secret.json] ~/.openclaw/workspace-safeclaw/google/client_secret.jsonTesting publishing status, you will need to add your demo Gmail account as a Test user: Google Auth Platform > Audience > Test Users.
# 1. Auth client
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway gog auth credentials /home/node/.openclaw/workspace/google/client_secret.json
# 2. Add account π‘ Use 'safeclaw' when prompted for a keyring password since this is the valude set in the docker-compose for GOG_KEYRING_PASSWORD.
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway gog auth add --manual [demo-email@gmai.com] --services gmail # other services include calendar,drive,contacts,docs,sheets
# 3. Verify
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway gog auth list
# 4. Test
docker compose -f deploy/compose/docker-compose.yaml exec openclaw-gateway gog gmail messages search "in:inbox" --max 10






