DEV Community

Cover image for Why I Built Gorgona: Turning Runaway AI Agents to Stone
Adrian M. Peticila
Adrian M. Peticila

Posted on

Why I Built Gorgona: Turning Runaway AI Agents to Stone

Running multiple digital brands simultaneously with autonomous AI agents sounds like a dream until you wake up to a $500 token bill, an agent stuck in an infinite tool call loop, or sensitive credentials leaked into public commits.

When you manage several brands alone, you cannot afford probabilistic safety. You need cold, deterministic discipline.

That is why I created Gorgona.


The Problem With Modern Autonomous Agents

Most agent frameworks operate on optimistic recursion. The agent plans, calls tools, observes outputs, and continues thinking. When an unexpected error occurs, the typical failure mode is disastrous:

  1. The Infinite Hallucination Loop: The agent attempts to fix a missing dependency, fails, repeats the same terminal command 15 times, and exhausts rate limits.
  2. Context Bleed: An agent working on Brand A accesses notes or credentials meant for Brand B, embedding them into commits or deploy scripts.
  3. The AI Slop Creep: Text generated by runaway prompts becomes saturated with buzzwords ("delve into", "tapestry of", "fostering innovation") and unneeded punctuation.

You do not solve deterministic engineering problems with probabilistic prompts like "Please be careful not to leak secrets".

You solve them with guardrails that turn runaway agents to stone.


What Is Gorgona?

Gorgona is a lightweight, zero-dependency Python engine designed to enforce uncompromising boundaries on AI agents.

       Autonomous Agent Step
                 │
                 ▼
         [ Gorgona Engine ]
                 │
  ┌──────────────┼──────────────┐
  ▼              ▼              ▼
Exposure     Isolation      Text Clean
 Guard         Guard          Guard
  │              │              │
  └──────────────┼──────────────┘
                 │
         [ Memory Graph ]
                 │
                 ▼
       Verified or Frozen
Enter fullscreen mode Exit fullscreen mode

If an agent violates a rule, Gorgona halts execution immediately. No polite warnings. No retries. The agent is frozen before disk writes or git commits can occur.


Four Pillars of Stone

1. Exposure Guard

Detects leaked credentials, Bearer tokens, private SSH keys, and sensitive environment files before any push or deploy action.

2. Isolation Guard

Enforces strict brand borders. If code or documentation for one client references identifiers from another client, execution stops immediately.

3. Text Cleaner Guard

Enforces strict prose discipline. It flags AI markers and eliminates characters that scream synthetic generation, including a strict zero em-dash policy.

4. Memory Graph Guard

Monitors agent recursion using depth-first search cycle detection. If an agent loops over the same action sequence, it triggers an immediate breaker.


Zero Dependencies Philosophy

Gorgona was built with standard Python libraries. No heavy dependencies. No network calls. No telemetry. It runs in milliseconds inside lightweight CI/CD containers, local CLI environments, or edge workers.

gorgona doctor
gorgona scan ./output-directory
Enter fullscreen mode Exit fullscreen mode

The Future of Solo Engineering

Operating as a solo builder at scale requires ruthless automation paired with ruthless constraints. Autonomous agents are incredible force multipliers, but only if they are held accountable to deterministic standards.

Gorgona is available open source on GitHub:
👉 https://github.com/adrianpeticila/gorgona

Turn runaway agents to stone. Build with discipline.

Top comments (0)