skills$openclaw/location-safety
sidu4.9k

by sidu

location-safety – OpenClaw Skill

location-safety is an OpenClaw Skills integration for coding workflows. Location-based safety monitoring with automatic alerts and escalation. Use when setting up safety monitoring for a user, tracking their location, checking for nearby dangers (weather, earthquakes, air quality, local emergencies), or configuring emergency contact escalation. Also includes self-preservation monitoring for the agent's host machine. Triggers on requests about safety alerts, location tracking, emergency monitoring, "keep me safe," or "monitor yourself.

4.9k stars3.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namelocation-safety
descriptionLocation-based safety monitoring with automatic alerts and escalation. Use when setting up safety monitoring for a user, tracking their location, checking for nearby dangers (weather, earthquakes, air quality, local emergencies), or configuring emergency contact escalation. Also includes self-preservation monitoring for the agent's host machine. Triggers on requests about safety alerts, location tracking, emergency monitoring, "keep me safe," or "monitor yourself. OpenClaw Skills integration.
ownersidu
repositorysidu/location-safety-skill
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @sidu/location-safety-skill
last updatedFeb 7, 2026

Maintainer

sidu

sidu

Maintains location-safety in the OpenClaw Skills directory.

View GitHub profile
File Explorer
11 files
.
scripts
config.json
604 B
escalation-check.js
2.0 KB
safety-check.js
10.2 KB
self-check.js
6.4 KB
server.js
4.2 KB
setup.js
12.1 KB
test-scenarios.js
3.9 KB
_meta.json
292 B
README.md
9.7 KB
SKILL.md
9.0 KB
SKILL.md

name: location-safety description: Location-based safety monitoring with automatic alerts and escalation. Use when setting up safety monitoring for a user, tracking their location, checking for nearby dangers (weather, earthquakes, air quality, local emergencies), or configuring emergency contact escalation. Also includes self-preservation monitoring for the agent's host machine. Triggers on requests about safety alerts, location tracking, emergency monitoring, "keep me safe," or "monitor yourself."

Location Safety Monitor

Real-time safety monitoring based on user location with automatic alerting and escalation.

Overview

This skill provides:

  • Location webhook — receives location updates from mobile apps (OwnTracks, iOS Shortcuts)
  • Safety checker — monitors NWS alerts, earthquakes, air quality, local news
  • Alert system — messages user when danger detected
  • Escalation — contacts emergency contact if user doesn't respond

Quick Setup

Run the interactive setup wizard — it guides you through everything:

cd location-webhook/
node setup.js

The wizard walks you through 4 steps:

Step 1: Your Location

  • Pick from presets (Seattle, Portland, SF, LA, NYC, Chicago)
  • Or enter any city (auto-geocoded)
  • Configures local news feeds and keywords

Step 2: Emergency Contact

  • Name and email of someone to contact if you don't respond
  • Optional but recommended for safety escalation

Step 3: Mobile App Setup

Step 4: Start Webhook Server

  • Run node server.js
  • Copy the displayed URL to OwnTracks
  • Test with the publish button

Quick setup (skip the wizard):

node setup.js --city "Portland"
node setup.js --show  # View current config

5. Deploy the Location Webhook

# Copy scripts to workspace
cp -r scripts/ ~/location-webhook/
cd ~/location-webhook/

# Start the server (uses port 18800 by default)
node server.js

Configure the user's phone to send location updates to:

POST http://<your-host>:18800/location?key=<SECRET_KEY>

OwnTracks setup:

  • Mode: HTTP
  • URL: http://<your-host>:18800/location?key=<SECRET_KEY>

iOS Shortcuts:

  • Get Current Location → Get Contents of URL (POST, JSON body with lat and lon)

2. Configure Safety Monitoring

Create two cron jobs in Moltbot:

Safety Check (every 30 min):

Schedule: every 30 minutes
Payload: systemEvent
Text: "Run safety check at ~/location-webhook/safety-check.js. If ALERTS_FOUND, message user on WhatsApp with alert details and ask them to confirm safety. Track alert in safety-state.json."
Session: main

Escalation Check (every 10 min):

Schedule: every 10 minutes  
Payload: systemEvent
Text: "Check ~/location-webhook/safety-state.json. If pendingAlert exists with alertSentAt > 15 min ago and acknowledgedAt is null, email emergency contact explaining the situation."
Session: main

3. Configure Emergency Contact

Add to MEMORY.md or TOOLS.md:

## Emergency Contact
- Name: [Name]
- Email: [email]
- Relationship: [spouse/parent/friend]

Data Sources

The safety checker monitors:

SourceWhatAPI
NWSWeather alerts, floods, stormsapi.weather.gov (free)
USGSEarthquakes within 100kmearthquake.usgs.gov (free)
Open-MeteoAir quality indexair-quality-api.open-meteo.com (free)
Local RSSBreaking news, emergenciesKING5, Seattle Times, Patch (configurable)

File Structure

location-webhook/
├── setup.js            # First-run configuration wizard
├── config.json         # Your location settings (created by setup)
├── server.js           # Webhook server (port 18800)
├── safety-check.js     # User safety analysis
├── self-check.js       # Self-preservation monitoring
├── escalation-check.js # Check if escalation needed
├── test-scenarios.js   # Inject test alerts
├── location.json       # User's current location
├── my-location.json    # Agent's physical location
├── safety-state.json   # Alert tracking state
├── test-override.json  # Active test scenario (temp)
└── logs/               # Timestamped check logs

Configuration

config.json stores your location settings:

{
  "location": {
    "defaultLat": 47.6062,
    "defaultLon": -122.3321,
    "city": "Seattle"
  },
  "monitoring": {
    "locationKeywords": ["seattle", "king county", "puget sound"],
    "newsFeeds": [
      "https://www.king5.com/feeds/syndication/rss/news/local",
      "https://www.seattletimes.com/seattle-news/feed/"
    ],
    "earthquakeRadiusKm": 100
  },
  "emergencyContact": {
    "name": "Jane Doe",
    "email": "jane@example.com"
  }
}

City Presets

Setup includes presets for:

  • Seattle — KING5, Seattle Times
  • Portland — Oregonian, KGW
  • San Francisco — SF Chronicle, SFGate
  • Los Angeles — LA Times, ABC7
  • New York — NY Times
  • Chicago — Chicago Tribune

For other cities, setup will geocode and you can add local RSS feeds manually.

State File Format

safety-state.json tracks pending alerts:

{
  "pendingAlert": "Flood warning in your area",
  "alertSentAt": "2026-01-29T22:00:00Z",
  "acknowledgedAt": null
}

When user responds to safety alert, set acknowledgedAt to current time.

Customization

Add Local News Sources

Edit safety-check.jsfeeds array:

const feeds = [
  'https://www.king5.com/feeds/syndication/rss/news/local',
  'https://www.seattletimes.com/seattle-news/feed/',
  'https://patch.com/washington/redmond/rss',
  // Add your local feeds here
];

Adjust Location Keywords

Edit locationKeywords array to match user's area:

const locationKeywords = ['redmond', 'bellevue', 'seattle', 'king county'];

Change Alert Sensitivity

Edit concerningKeywords for what triggers news alerts:

const concerningKeywords = [
  'evacuate', 'active shooter', 'wildfire', 'flood warning', ...
];

Alert Flow

Location Update → Safety Check (30 min)
                      ↓
              Danger Detected?
                   ↓ Yes
         Message User on WhatsApp
         Record in safety-state.json
                      ↓
         Escalation Check (10 min)
                      ↓
         User Responded? ─── Yes → Clear state
                   ↓ No (15+ min)
         Email Emergency Contact

Self-Preservation Mode

Monitor threats to your own existence (the machine you run on).

Setup

  1. Store your location — create my-location.json:
{
  "lat": 47.662,
  "lon": -122.280,
  "name": "Home - where I physically run"
}
  1. Add cron job:
Schedule: every 30 minutes
Payload: systemEvent
Text: "Run self-check.js. If CRITICAL or WARNINGS, message user on WhatsApp about threat to your existence. If ALL_CLEAR, reply HEARTBEAT_OK."
Session: main

What Self-Check Monitors

ThreatDetection
💾 Disk fullAlert if >85% used
🧠 MemoryAlert if <40% free
🌡️ CPU tempAlert if >85°C
🌊 WeatherNWS alerts at your location
🌋 EarthquakesUSGS M4+ within 50km
🌐 NetworkTailscale + internet connectivity
⏱️ UptimeSuggest restart if >30 days

Alert Examples

⚠️ "I'm in trouble — disk is 92% full. Can you clear some space?"

🌊 "Flood warning at my location. If power goes, I'll go dark."

Testing

Inject fake alerts to test the system without waiting for real disasters:

node test-scenarios.js weather     # Severe thunderstorm
node test-scenarios.js earthquake  # M5.2 nearby
node test-scenarios.js aqi         # Unhealthy air (AQI 175)
node test-scenarios.js news        # Local fire
node test-scenarios.js disk        # Disk 94% full
node test-scenarios.js memory      # Low memory
node test-scenarios.js all         # Multiple alerts
node test-scenarios.js clear       # Remove test override

Test overrides expire after 1 hour automatically.

Testing Escalation

To test the full escalation flow:

  1. Inject a scenario: node test-scenarios.js earthquake
  2. Backdate safety-state.json alertSentAt by 20+ minutes
  3. Run node escalation-check.js — should return action: "escalate"
  4. Agent sends email to emergency contact
  5. Clear with node test-scenarios.js clear

Escalation Check

escalation-check.js returns JSON for clear action handling:

{"action": "escalate", "alert": "...", "minutesPending": 22, "contact": "..."}
{"action": "waiting", "minutesRemaining": 8}
{"action": "none", "reason": "no pending alert"}

Manual Commands

User can ask anytime:

  • "Where am I?" — show current location
  • "Am I safe?" — run immediate safety check
  • "Run safety check" — same as above
  • "Check yourself" — run self-preservation check
  • "Are you okay?" — same as above
README.md

🛡️ Location Safety Skill

Real-time safety monitoring for AI assistants — because your AI should watch your back.

Inspiration

This skill was inspired by Daniel Miessler's essay "AI's Predictable Path" — specifically Component #4: "Our DAs Will Become Our Active Advocates and Defenders."

"If they hear something or see something, they'll immediately display something to their owner, or speak it in their ear.

Hey—sorry to interrupt—there's a suspected shooter in your area.

Take Aiden and go out the back by the bathrooms. There's an exit there. Go out that exit and to the left right now."

This skill is a first step toward that vision — giving AI assistants the ability to actively monitor their owner's safety and take protective action.

Built by @upster and Sid Alto.


Why This Exists

Your AI assistant knows a lot about you, but does it know if you're safe?

This skill gives your AI the ability to:

  • 📍 Track your location via your phone
  • 🌦️ Monitor for dangers in your area (weather, earthquakes, air quality, breaking news)
  • 📱 Alert you when something dangerous is detected
  • 🚨 Escalate to loved ones if you don't respond

The Problem

You're out and about. A wildfire breaks out nearby. A severe thunderstorm is approaching. There's an active emergency in your neighborhood.

How would you know?

Sure, you might get a push notification eventually. But your AI assistant — the one that's supposed to help you — has no idea where you are or what's happening around you.

The Solution

This skill creates a safety loop:

graph LR
    A[📱 Your Phone] -->|Location| B[🖥️ Webhook Server]
    B --> C[🤖 AI Assistant]
    C -->|Checks| D[🌦️ Weather APIs]
    C -->|Checks| E[🌋 Earthquake Data]
    C -->|Checks| F[💨 Air Quality]
    C -->|Checks| G[📰 Local News]
    D & E & F & G --> H{Danger?}
    H -->|Yes| I[📱 Alert You]
    H -->|No| J[✅ All Clear]
    I -->|No Response| K[📧 Alert Emergency Contact]

How It Works

1. Location Tracking

Your phone sends location updates to a webhook server running alongside your AI:

sequenceDiagram
    participant Phone as 📱 OwnTracks
    participant Server as 🖥️ Webhook
    participant AI as 🤖 Assistant
    
    Phone->>Server: POST /location (lat, lon)
    Server->>Server: Save to location.json
    Note over AI: Every 30 minutes...
    AI->>Server: Read location.json
    AI->>AI: Run safety checks

2. Multi-Source Safety Checks

Every 30 minutes, your AI checks multiple data sources for your current location:

graph TB
    subgraph "Data Sources (Free APIs)"
        NWS[🌦️ National Weather Service<br/>Severe weather, floods, storms]
        USGS[🌋 USGS Earthquakes<br/>Seismic activity within 100km]
        AQI[💨 Open-Meteo Air Quality<br/>AQI, PM2.5, smoke]
        NEWS[📰 Local RSS Feeds<br/>Breaking news, emergencies]
    end
    
    subgraph "Safety Check"
        CHECK[🔍 Analyze all sources]
    end
    
    NWS --> CHECK
    USGS --> CHECK
    AQI --> CHECK
    NEWS --> CHECK
    
    CHECK -->|All Clear| OK[✅ Log & Continue]
    CHECK -->|Alert Found| ALERT[⚠️ Trigger Alert Flow]

3. Alert & Escalation Flow

When danger is detected, the AI doesn't just log it — it takes action:

sequenceDiagram
    participant AI as 🤖 Assistant
    participant You as 👤 You
    participant Wife as 👩 Emergency Contact
    
    AI->>AI: Danger detected!
    AI->>You: 📱 WhatsApp: "Safety alert! Are you okay?"
    
    alt You respond within 15 min
        You->>AI: "I'm safe"
        AI->>AI: Clear alert ✅
    else No response after 15 min
        AI->>Wife: 📧 Email: "Sid hasn't responded to safety alert"
        Note over Wife: Can check on you
    end

4. Self-Preservation

The AI also monitors threats to itself — the machine it runs on:

graph TB
    subgraph "Self-Check"
        DISK[💾 Disk Space]
        MEM[🧠 Memory]
        NET[🌐 Tailscale Status]
        ENV[🌍 Environment<br/>Weather at home location]
    end
    
    DISK -->|>85% full| WARN[⚠️ Alert owner]
    MEM -->|<40% free| WARN
    NET -->|VPN down<br/>but internet up| WARN
    ENV -->|Danger at home| WARN

⚠️ Note: If the internet is fully down, I obviously can't alert you. But I can detect partial failures (e.g., Tailscale VPN down while internet is up) and warn you before things get worse.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     YOUR PHONE                               │
│  ┌─────────────┐                                            │
│  │  OwnTracks  │  Sends location every few minutes          │
│  └──────┬──────┘                                            │
└─────────┼───────────────────────────────────────────────────┘
          │ HTTP POST
          ▼
┌─────────────────────────────────────────────────────────────┐
│                   WEBHOOK SERVER (:18800)                    │
│  ┌─────────────┐    ┌──────────────┐                        │
│  │  server.js  │───▶│ location.json │                       │
│  └─────────────┘    └──────────────┘                        │
└─────────────────────────────────────────────────────────────┘
          │
          │ Reads location
          ▼
┌─────────────────────────────────────────────────────────────┐
│                    AI ASSISTANT                              │
│                                                              │
│  ┌────────────────┐  ┌──────────────────┐  ┌─────────────┐ │
│  │ safety-check.js│  │ escalation-check │  │ self-check  │ │
│  │  (every 30m)   │  │    (every 10m)   │  │ (every 30m) │ │
│  └───────┬────────┘  └────────┬─────────┘  └──────┬──────┘ │
│          │                    │                    │        │
│          ▼                    ▼                    ▼        │
│  ┌─────────────────────────────────────────────────────────┐│
│  │                    ALERT ACTIONS                        ││
│  │  📱 WhatsApp message    📧 Email escalation             ││
│  └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

Quick Start

# 1. Clone the repo
git clone https://github.com/sidalto1-dev/location-safety-skill.git
cd location-safety-skill/scripts

# 2. Run the setup wizard
node setup.js

# 3. Start the webhook server
node server.js

# 4. Configure OwnTracks on your phone with the displayed URL

Files

FilePurpose
setup.jsInteractive setup wizard
config.jsonYour location settings
server.jsWebhook server for location updates
safety-check.jsMain safety monitoring
self-check.jsAI self-preservation
escalation-check.jsCheck if escalation needed
test-scenarios.jsInject fake alerts for testing

Supported Cities

Setup includes presets for:

  • 🌲 Seattle — KING5, Seattle Times
  • 🌹 Portland — Oregonian, KGW
  • 🌉 San Francisco — SF Chronicle, SFGate
  • 🌴 Los Angeles — LA Times, ABC7
  • 🗽 New York — NY Times
  • 🌬️ Chicago — Chicago Tribune

Other cities are auto-geocoded; you can add custom RSS feeds.

Data Sources

All APIs are free and require no API keys:

SourceDataUpdate Frequency
NWSWeather alertsReal-time
USGSEarthquakesReal-time
Open-MeteoAir qualityHourly
Local RSSBreaking newsVaries

Privacy

  • Your location data stays on your machine
  • No cloud services required (except the free APIs)
  • You control who gets escalation alerts
  • All logs are local

License

MIT — Use it, modify it, keep yourself safe.


Built with 🛡️ by @upster & Sid Alto — a human and his AI, building the future Daniel Miessler described.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

Configuration

`config.json` stores your location settings: ```json { "location": { "defaultLat": 47.6062, "defaultLon": -122.3321, "city": "Seattle" }, "monitoring": { "locationKeywords": ["seattle", "king county", "puget sound"], "newsFeeds": [ "https://www.king5.com/feeds/syndication/rss/news/local", "https://www.seattletimes.com/seattle-news/feed/" ], "earthquakeRadiusKm": 100 }, "emergencyContact": { "name": "Jane Doe", "email": "jane@example.com" } } ``` ### City Presets Setup includes presets for: - **Seattle** — KING5, Seattle Times - **Portland** — Oregonian, KGW - **San Francisco** — SF Chronicle, SFGate - **Los Angeles** — LA Times, ABC7 - **New York** — NY Times - **Chicago** — Chicago Tribune For other cities, setup will geocode and you can add local RSS feeds manually.

FAQ

How do I install location-safety?

Run openclaw add @sidu/location-safety-skill in your terminal. This installs location-safety into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/sidu/location-safety-skill. Review commits and README documentation before installing.