DEV Community

Aneesh Grover
Aneesh Grover

Posted on AI-assisted

An agent that fixes your servers, repairs configs and asks before anything risky (MHacks 26)

This is a submission for the MLH x DEV Writing Challenge

What was Built

Nightshift is an agent that has terminal access to your machines while their owner is away. It finds the problem and proposes the fix. A gate decides whether the fix may run, and a small board on the desk is where a human says yes.

A service dies. Within a few seconds the agent has read the logs, checked a library of known fixes and written a log. If the fix is safe, it runs alone. If it needs a person, the FREE-WILi board turns orange and shows APPROVE. A green press lets that one command run, exactly once. The device snapshots itself first, checks its health afterwards, and rolls back by itself if the check fails.

The model never decides what it may do. A policy file does, so a confused or manipulated model can't talk its way up a level. Ask it to delete files and the request hits a rule; nothing runs.

Devices dial out to the database, so none of them opens an inbound port. Fixes earn trust one at a time: after three verified successes a fix stops asking and the board says EARNED. One failure sends it back to asking.

Approvals are live rows, so the board, a phone page and the dashboard change together. The phone can approve over mobile data through a private Tailscale link. And two hard shakes of the board revoke everything the agent was allowed to do.

Demo

The demo is a test bench. Faults are injected on demand into containers that play servers, and into a Pixel 9 Pro over adb, so every run starts from a known failure and plays the whole loop.

The dashboard draws it as a night garden. Each device is a flower. A broken service wilts it, a fix brings it back.

Partner Technologies

FREE-WILi. The board is the input and the status light. Its screen fits one short word, so each state gets one: IDLE, APPROVE, FIXING, HEALTHY, EARNED, BLOCKED. Seven LEDs add color, so a glance across the room says what the agent is doing. Five buttons approve, deny, undo and show events, and the accelerometer drives the double-shake kill switch. A small Python bridge passes events along as JSON lines and reconnects by itself when the board re-enumerates.

Gemini API. The agent loop calls Gemini with function calling and says why before it acts. A fix costs about 3,000 to 6,000 tokens, roughly a tenth of a cent. If the network drops, the loop switches to a local Qwen model on the laptop GPU.

SpacetimeDB. Approvals are rows with rules attached: who may approve, who may revoke, when a grant expires. The database enforces them and pushes every change to whatever is subscribed, so a board, a phone and a browser behave as one surface.

.Tech. night-shift.tech points at the project site.

Hackathon Experience

This was a submission to MHacks 2026 in Ann Arbor. Met a lot of people, heard about their ideas and shared one of my own. Since I wanted to work on something networking and infra related, I worked solo. This submission did not win, but it was fun working on something I find cool and telling others about it.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.