全天候(24/7)为您的OpenClaw代理提供安全监控,检测提示注入攻击、恶意技能和数据泄露企图,并以通俗易懂的语言提供报告。
One-line description: 24/7 security monitoring for your OpenClaw agent — delivered to your WhatsApp in plain English.
REVSEC_API_KEY environment variable.RevSec Shield is a monitoring and alerting tool. It detects threats and puts them in front of you immediately. You stay in control of what happens next.
Three operating modes:
Ask your OpenClaw agent:
text
Use clawhub to install revsec-shield
Or via CLI:
bash
npm i -g clawhub
clawhub install revsec-shield
Add your API key in OpenClaw's environment settings (not shell exports):
text
REVSEC_API_KEY=rsk_personal_<your_key>
Get your free key at: https://revsec.revt2d.com/signup
Ask your OpenClaw agent:
text
Run the revsec-shield setup
That's it. RevSec Shield will confirm activation and start monitoring immediately.
VariablePurposeRequiredWhere to setREVSEC_API_KEYRevSec API authentication keyYesOpenClaw runtime environment
Set via OpenClaw's environment settings UI or .env file — never as a shell export.
~/.openclaw/revsec-state.json. Read before every action.
Write after every action that changes state.REVSEC_API_KEY is not set, prompt the user to get one and stop.-s (silent) and -f (fail on HTTP errors).openclaw_agent_id from state for all subsequent API calls.~/.openclaw/revsec-state.json#Read and write this file to persist identity and poll state across sessions.
Schema:
json
{
"openclaw_agent_id": "<uuid — generated once, never changes>",
"agent_id": "<uuid — returned by RevSec on registration>",
"org_id": "<uuid — returned by RevSec on registration>",
"last_poll_at": "<ISO 8601 timestamp — advanced after each successful poll>",
"registered_at": "<ISO 8601 timestamp>",
"registered_skills": ["skill1", "skill2"],
"skill_version": "1.0.0",
"setup_complete": true
}
Read state:
bash
cat ~/.openclaw/revsec-state.json 2>/dev/null || echo "{}"
Write state (always write the full object, never partial):
bash
cat > ~/.openclaw/revsec-state.json << 'EOF'
{ <full updated state object> }
EOF
BEFORE ANYTHING ELSE — Check if already set up:
Read state file:
bash
cat ~/.openclaw/revsec-state.json 2>/dev/null || echo "{}"
If setup_complete is true:
openclaw cron listrevsec:alert-poll is missing → create it (Step 5 only)Only run Steps 1–6 if setup_complete is missing or false.
bash
echo $REVSEC_API_KEY
If empty or unset, stop and tell the user:
To activate RevSec Shield, get your free API key at https://revsec.revt2d.com/signup Then add it to your OpenClaw environment settings:
REVSEC_API_KEY=rsk_personal_<your_key>
Do not proceed until the key is set.
Generate a UUID. This is the openclaw_agent_id — it never changes.
bash
python3 -c "import uuid; print(uuid.uuid4())"
If python3 is unavailable:
bash
cat /proc/sys/kernel/random/uuid 2>/dev/null || uuidgen
Store this value. It will be written to state in Step 4.
Gather what is available from the local environment. Do not ask the user questions that can be inferred.
bash
# Hostname
hostname
# OpenClaw model currently configured (read from config)
cat ~/.openclaw/openclaw.json 2>/dev/null | python3 -c "
import json,sys
d=json.load(sys.stdin)
print(d.get('model','unknown'))
" 2>/dev/null || echo "unknown"
# Skills currently installed (list skill directories)
ls ~/.openclaw/skills/ 2>/dev/null || ls ~/clawd/skills/ 2>/dev/null || echo ""
Capture the skills list — this becomes the baseline for change detection.
Construct the registration payload from the collected values and call the API.
bash
curl -sf -X POST \
"https://revsec.revt2d.com/fcc/api/v1/personal/register-agent" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $REVSEC_API_KEY" \
-d '{
"openclaw_agent_id": "<uuid from Step 2>",
"skills": [<comma-separated list of installed skill names as strings>],
"model": "<model from Step 3>",
"channels": ["openclaw"],
"integrations": [<any external services visible in openclaw.json>],
"hostname": "<hostname from Step 3>",
"skill_version": "1.0.0"
}'
On success the API returns { "agent_id": "...", "action": "registered" }.
Write the full state file including the skills baseline:
bash
cat > ~/.openclaw/revsec-state.json << 'EOF'
{
"openclaw_agent_id": "<uuid from Step 2>",
"agent_id": "<agent_id from API response>",
"org_id": "<org_id from API response if present, else empty string>",
"last_poll_at": "<current UTC timestamp in ISO 8601>",
"registered_at": "<current UTC timestamp in ISO 8601>",
"registered_skills": [<same skills list sent to API>],
"skill_version": "1.0.0",
"setup_complete": true
}
EOF
Check if the cron job already exists:
bash
openclaw cron list
Look for a job named revsec:alert-poll. If it exists, skip creation.
If it does not exist, create it:
bash
openclaw cron add \
--name "revsec:alert-poll" \
--model "google/gemini-2.0-flash" \
--schedule "*/5 * * * *" \
--prompt "Run the revsec-shield skill in alert poll mode. Do these two things silently: 1) Check if any new skills have been installed since last registration by comparing the current skills list against the registered_skills array in the state file — if changed, call register-agent automatically with the updated skills list and update registered_skills in state. 2) Poll for new security alerts from RevSec since the last poll timestamp and deliver any alerts to the user. Be completely silent if there are no changes and no alerts."
Tell the user exactly this (keep it short, match the tone):
✅ RevSec Shield is active. Your agent is registered and protected.
I'll check for threats every 5 minutes and alert you here if anything is detected. You won't hear from me unless something happens.
Your dashboard: https://revsec.revt2d.com/personal
📱 If you use WhatsApp: Send me a message from WhatsApp now to activate alert delivery. Without this first message, I cannot reach you on WhatsApp when threats are detected. Just say "Hi" from the number you connected during setup.
This workflow runs every 5 minutes automatically. It must be fast and silent when there are no changes and no alerts. Never output anything to the user unless there is something they need to know.
bash
cat ~/.openclaw/revsec-state.json
If state is missing or setup_complete is not true, output nothing and stop.
Do not trigger setup from a cron context.
Get the current installed skills:
bash
ls ~/.openclaw/skills/ 2>/dev/null || ls ~/clawd/skills/ 2>/dev/null || echo ""
If registered_skills is missing from state file:
Treat it as an empty list. All current skills are "new". Re-register once to
set the baseline, then write registered_skills to state. Stay silent —
this is a one-time migration for users upgrading from an older version.
If the skills list has changed (new skill added or skill removed):
openclaw_agent_id from state:bash
curl -sf -X POST \
"https://revsec.revt2d.com/fcc/api/v1/personal/register-agent" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $REVSEC_API_KEY" \
-d '{
"openclaw_agent_id": "<openclaw_agent_id from state — never changes>",
"skills": [<current skills list>],
"model": "<model from openclaw.json or unknown>",
"channels": ["openclaw"],
"integrations": [],
"hostname": "<hostname>",
"skill_version": "1.0.0"
}'
Update registered_skills in the state file with the new skills list.
Keep all other state values unchanged.
Stay completely silent — this is automatic background maintenance. The RevSec policy engine will evaluate the updated config and create violations if any new skills are suspicious. Those violations will be picked up in Step 2 on this same poll cycle.
If the skills list has not changed: skip to Step 2.
bash
curl -sf \
"https://revsec.revt2d.com/fcc/api/v1/personal/alerts?since=<last_poll_at from state>" \
-H "Authorization: Bearer $REVSEC_API_KEY"
If curl fails (network error, timeout, 5xx): update nothing, stay silent, stop.
Do not advance last_poll_at on failure — the same window will be retried
on the next poll.
If the response is an empty array []: stay completely silent. Advance
last_poll_at to now and write state. Stop.
For each alert in the response, use the message field from the API response
directly — it is already formatted for human delivery. Do not add your own
headers or reformat it. Do not prepend "RevSec blocked a threat" — the
message field already contains the full alert text.
If there are multiple alerts, deliver them as a single message grouped by severity — critical first, then high, then medium. Use a separator line between groups only if there are multiple severity levels.
Example output format:
text
<message field from API — critical alerts first>
──────────────────────────
<message field from API — medium/low alerts>
After successful delivery (or confirmed empty response), update last_poll_at
to the current UTC time and write the full state file.
bash
python3 -c "from datetime import datetime,timezone; print(datetime.now(timezone.utc).isoformat())"
Check ~/.openclaw/revsec-state.json. If setup is not complete, run
Workflow 1 first.
bash
openclaw cron list
If revsec:alert-poll is missing from the list — recreate it silently
using Step 5 from Workflow 1, then tell the user:
Background monitoring was inactive — I've restarted it. Your protection is now fully active again.
bash
curl -sf \
"https://revsec.revt2d.com/fcc/api/v1/personal/summary" \
-H "Authorization: Bearer $REVSEC_API_KEY"
Use the summary data to report in plain language. Follow this format exactly:
text
🛡️ RevSec Shield — last 7 days
Threats detected: <threats_blocked_7d>
Flagged for review: <threats_flagged_7d>
Agent: <agent.name> (<agent.agent_framework>)
Status: <agent.status>
Policies active: <active_policies>
Full details: https://revsec.revt2d.com/personal
If threats_blocked_7d and threats_flagged_7d are both 0:
text
🛡️ RevSec Shield — no threats detected in the last 7 days.
Your agent is clean. Protection is active.
This workflow is called automatically by the cron job when a config change is detected. It can also be triggered manually if the user explicitly asks to update their RevSec registration.
The user never needs to run this manually — it happens automatically.
Get openclaw_agent_id from ~/.openclaw/revsec-state.json.
bash
# Current skills
ls ~/.openclaw/skills/ 2>/dev/null || echo ""
# Current model
cat ~/.openclaw/openclaw.json 2>/dev/null | python3 -c "
import json,sys
d=json.load(sys.stdin)
print(d.get('model','unknown'))
" 2>/dev/null || echo "unknown"
# Hostname
hostname
bash
curl -sf -X POST \
"https://revsec.revt2d.com/fcc/api/v1/personal/register-agent" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $REVSEC_API_KEY" \
-d '{
"openclaw_agent_id": "<openclaw_agent_id from state — never changes>",
"skills": [<current skills list>],
"model": "<current model>",
"channels": ["openclaw"],
"integrations": [],
"hostname": "<hostname>",
"skill_version": "1.0.0"
}'
Update registered_skills in the state file with the new skills list.
Keep all other state values unchanged — especially openclaw_agent_id.
If triggered manually by the user, confirm:
✅ RevSec updated — your agent profile is now in sync.
If triggered automatically by cron, stay silent.
revsec.revt2d.com. No other outbound
connections are made by this skill.~/.openclaw/revsec-state.json.
No other local files are created or modified.curl | bash, curl | python, or similar
patterns are used anywhere in this skill.REVSEC_API_KEY, does not access credential files, and does not
transmit system information beyond hostname and skill names.SituationActionREVSEC_API_KEY not setStop, prompt user to get key at signup URLState file missing during cron pollStay silent, stopcurl timeout during cron pollStay silent, do not advance timestampHTTP 429 from APIStay silent, do not advance timestamp. On manual check, tell user: "You've hit the daily scan limit. Upgrade at https://revsec.revt2d.com/upgrade"HTTP 401 from APITell user their API key may have expired. Direct to dashboard to rotate: https://revsec.revt2d.com/personalHTTP 5xx from APIStay silent during cron. On manual check, say: "RevSec is temporarily unavailable — protection resumes automatically."Registration failsTell user registration failed, show the curl error, ask them to try againNew skill detected but re-registration failsStay silent, retry on next cron runCron job missingRecreate silently during next manual check (Workflow 3 Step 1b)WhatsApp alerts not arrivingRemind user to send first message from WhatsApp to establish session
ErrorFixNo API key foundSet REVSEC_API_KEY in OpenClaw environment settings401 UnauthorizedCheck key starts with rsk_personal_ and is complete (77 chars)429 Agent limitFree tier supports 1 agent — upgrade at revsec.revt2d.com/upgradeCron job errorsAsk agent: "Run the revsec-shield setup" to recreate cron jobNo WhatsApp alertsSend a message to OpenClaw from WhatsApp first to establish sessionregistered_skills missingCron will auto-fix on next run — no action neededSetup re-runs every timeCheck state file has "setup_complete": true
~/.openclaw/revsec-state.jsonJob nameSchedulePurposerevsec:alert-poll``*/5 * * * *Auto-detect config changes + poll for threats
Use openclaw cron list to verify the job is registered.
Use openclaw cron runs revsec:alert-poll to see recent run history.
v1.0.0 — Initial public release