DEV Community

Cover image for Stop your AI Agent from Hallucinating with a "Red Telephone" ☎️
Dante Harker
Dante Harker

Posted on

Stop your AI Agent from Hallucinating with a "Red Telephone" ☎️

Building autonomous agents with Claude or Python? You know the fear.

It starts well. The agent is coding, fixing bugs, and feeling productive. Then, confidence drops. It gets stuck in a loop. Or worse, it decides to "fix" your database by deleting the production table.

We need a way to stop the chaos without killing the process.

I built a standardised Model Context Protocol (MCP) Server called the Red Telephone. It gives your AI an "Emergency Brake" that pings your Telegram for approval before executing sensitive actions.

How it works

Instead of letting the Agent guess, we give it a tool to "call home."

When the Agent hits a critical decision (e.g., executing SQL, sending a payment, deleting a file), it triggers the human_relay tool.


python
# The Agent calls the tool automatically when confidence is low
result = await call_human_relay(
    question="I am about to delete the production database. Proceed?",
    options=["Approve", "Deny"]
)

if result == "Approve":
    delete_database() # Only happens if YOU clicked yes on Telegram.
else:
    print("Aborted by Human.")
Enter fullscreen mode Exit fullscreen mode

Top comments (0)