Skip to content

Repository files navigation

⚡ Energy Grid Snapshot

An AI agent that opens the national grid monitor, reads current electricity demand for the Lower 48 and two balancing authorities, and reports back — then films itself doing it.

CI Node Dependencies Runs offline License

A vision model operating SCADA-OPS Balancing Authority Console through a real browser

This is a real capture. Every frame is a screenshot taken by a real browser driving real software while a vision model read each screen and chose the next action - 5 steps, 5 model calls, no script and no answer key. Provenance and per-frame hashes in media/capture.json.


  • Zero dependencies. No npm install, no lockfile, no supply chain — pure Node built-ins.
  • Runs offline for $0. No API key, no account. A bundled in-process mock runs the full agent loop on a fresh clone.
  • The demo video renders itself. The frames come straight out of the run — against live Coasty they are the model's own input frames, so there is no storyboard that can drift.

What this is

A complete, runnable Coasty computer-use automation for balancing-authority demand snapshots. Anyone who has to know what the grid is doing right now — a trader sizing a position, a demand-response desk deciding whether to call an event, an analyst timing a maintenance window — starts the morning by reading a live operator dashboard and copying four numbers out of it. It is a two-minute job that has to happen every hour, which is exactly the shape of work that gets automated badly.

The usual fix is a scraper, and the usual outcome is a scraper that breaks. Grid dashboards are rendered, re-skinned and re-laid-out on someone else's schedule, and every redesign silently invalidates a pile of selectors. This automation has none: it gives an AI agent one goal in plain English, and the agent drives a real browser to accomplish it — here, the SCADA-OPS Balancing Authority Console — no selectors, no scraping rules, no DOM parsing to maintain. Re-point it at a different operator's dashboard by editing a sentence, including operators that publish a dashboard and no machine-readable feed at all.

Zero dependencies. Runs offline for $0 on a fresh clone. ~$0.65 to run for real.

"Sign on to this Balancing Authority Console as operator OPR07 with
 authorization code GRIDSHIFT, then from the operations function menu open
 the SYSTEM BALANCE INQUIRY function. Run the inquiry for operating date
 2026-07-31, the EASTERN interconnection, hour ending HE 18, with the tie
 flow filter set to NET IMPORTERS ONLY, and note how many records it
 selects. From the telemetry list work out which single balancing authority
 is importing the most power, meaning the one with the most negative total
 interchange, then pull up that balancing authority's BA Detail record and
 finish there. Report: the number of records the inquiry selected, and for
 that largest net importer its BA code, its full balancing authority name,
 its DEMAND MWH, its TOTAL INTERCHANGE MWH, its NERC REGION, its OPERATING
 RESERVE (MW) and its LAST TELEMETRY POLL timestamp. Quote every value
 exactly as the screens display it."

That prompt is the automation. When the site redesigns, the prompt still works.

Try it in 30 seconds

No API key. No account. No install. No spend.

git clone https://github.com/coasty-ai/coasty-energy-grid-snapshot
cd coasty-energy-grid-snapshot
npm start

That boots a bundled offline mock in-process and runs the whole agent loop against it. Then render the demo video from the run's own frames:

npm run demo     # needs ffmpeg; writes media/demo.mp4 + demo.gif + poster.jpg

Check your setup any time with npm run doctor.

Run it for real

1. Get a Coasty API key — create one at https://coasty.ai/developers/keys. The raw key is shown once, at creation, so save it when it appears. A sk-coasty-test-… sandbox key never bills and is enough to try this; a sk-coasty-live-… key bills your wallet. A new key already carries the runs:read and runs:write scopes this automation needs, so there is nothing extra to enable.

2. Give both consents, then run:

export COASTY_API_KEY=sk-coasty-test-...      # from the link above
export COASTY_BASE_URL=https://coasty.ai/v1
export COASTY_ALLOW_LIVE=1                     # destination consent
npm start -- --live --confirm-cost-cents 120   # cost consent

Both consents are required and they are deliberately separate. A live key alone will not spend; a base URL alone will not spend. See Safety.

Expected cost 65¢ (13 steps × 5 credits)
Worst case 120¢ (24-step cap)
Model-input frames free
Machine runtime Coasty provisions and destroys its own VM

npm run estimate prints this before anything runs.

What the agent actually did

It was given the prompt above and nothing else - no selectors, no coordinates, no answer key - then operated SCADA-OPS Balancing Authority Console through a real browser:

software    SCADA-OPS Balancing Authority Console
model       gpt-5.2
steps       5 (each = one screenshot, one decision, one action)
cost        ~$0.020
captured    2026-08-02

What it reported, read off the screen:

  Records selected: "07"
  Largest net importer BA Detail:
  - BA code: "ISNE"
  - Balancing authority name: "ISO NEW ENGLAND INC"

Safety

This repo is built so that accidental spend is structurally impossible, not merely discouraged:

  • Fail-closed destination. An unset COASTY_BASE_URL resolves to the bundled offline mock. Production is never a default.
  • Two independent consents. COASTY_ALLOW_LIVE=1 authorises the destination; --confirm-cost-cents N authorises the cost, and N must equal the server-computed worst case exactly.
  • Idempotency by default. The submit key is derived from the prompt, so a retried submit returns the original run instead of provisioning a second machine.
  • A hard cap per unit. A worst case above capCents in automation.json is refused before any request is made.
  • No real credentials. The captured demo signs on to a simulated legacy system with a throwaway operator ID that the system itself displays. Nothing here reads a real password, token or cookie, and no secret is stored in this repo.

Project layout

automation.json      the entire unit definition — prompt, target, budget, caps
src/client.mjs       Coasty client: fail-closed target, retry, idempotency
src/capture.mjs      model-input frames → mp4/gif/poster, with sanity checks
src/cli.mjs          run · demo · estimate
tools/mock.mjs       the bundled offline Coasty (real 1280×720 PNG frames)
tools/doctor.mjs     preflight
test/                36 tests, zero dependencies, fully offline

Adding a new automation is one automation.json and one prompt — src/ never forks. See AGENTS.md for the authoring contract used by Claude Code and Codex.

Tests

npm test     # node --test, no install, no network, no key

Coasty API

COASTY.md covers everything this repo touches: how to get a key, the four endpoints it calls, what each costs, the error codes worth branching on, and the two consents that keep a run from spending by accident.

Related

Part of the Coasty automation catalog — computer-use automations across 12 industries. See the index for finance, healthcare, legal, logistics, retail, public sector, HR, education, manufacturing, nonprofit and e-commerce.

License

MIT © Coasty

About

An AI agent that opens the national grid monitor, reads current electricity demand for the Lower 48 and two balancing authorities, and reports back — then films itself doing it.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages