Skip to content

machineid-io/machineid-runtime-kill-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MachineID — Runtime Kill Switch Demo

This repository demonstrates a true runtime kill switch for autonomous execution.

A running worker process:

  • Registers once
  • Validates repeatedly
  • Halts immediately when its external permission is revoked

No redeploys.
No signals.
No cooperation from the runtime.


What This Demonstrates

This demo shows how MachineID enforces external, non-cooperative control over execution.

The running process:

  • Does not decide when it stops
  • Does not receive warnings
  • Does not degrade gracefully

If validation fails, execution halts.


Requirements


Setup

1. Install dependencies

pip install -r requirements.txt

2. Set environment variables

export MACHINEID_ORG_KEY=org_your_key_here
export MACHINEID_DEVICE_ID=kill-switch-demo-01

Running the Demo

Terminal 1 — Start the runaway agent (heartbeat loop)

python runaway_agent.py

This process will continue running as long as validation succeeds.


Terminal 2 — Operator kill switch (interactive)

In a second terminal:

python kill_switch_worker.py

Then type:

revoke

The agent in Terminal 1 will halt on the next validation boundary.

Important:

  • The running process exits immediately.
  • It does NOT restart automatically.

To allow future execution again:

restore

After restoring, you must manually restart the agent in Terminal 1.

To check current permission state:

status

Alternative: Revoking from the MachineID Dashboard

You can also revoke from the dashboard while Terminal 1 is running:

  1. Open https://machineid.io/dashboard
  2. Locate the running device
  3. Click Revoke

On the next validation boundary, the agent halts immediately.

allowed = false

This allows operators to stop execution:

  • From another machine
  • From a mobile device
  • During an incident or escalation
  • Without SSH access
  • Without redeploying
  • Without restarting the process

Authority lives outside the runtime.


Why This Matters

Most systems rely on cooperative control:

  • “Please stop”
  • “Check this flag”
  • “We’ll shut it down on the next deploy”

These approaches fail under:

  • Runaway loops
  • Leaked credentials
  • Stale intent
  • Unattended execution
  • Incident response pressure

This demo shows enforced control, not advisory signals.

Execution does not negotiate.


The Core Invariant

All behavior reduces to one rule:

Register. Validate. Work.

If validation fails, work does not continue.


Files in This Repo

  • runaway_agent.py — Long-running agent with validation boundaries
  • kill_switch_worker.py — Interactive operator console (revoke / restore / status)
  • requirements.txt — Minimal dependencies
  • README.md — This document

Related Links


License

MIT License
Built by MachineID.io

About

External kill switch for autonomous runtimes. Validate at enforcement boundaries. Revoke to halt execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages