AI / INTERMEDIATE / +230 XP

AI agents are workflow engines with opinions

An agent that cannot act is a chatbot. The difference is the action layer.

An agent that cannot act is a chatbot. The difference is the action layer. AI agents are not large language models with ambition. They are workflow engines with an action layer, error recovery, and a state machine. The LLM is the brain. The action layer is the hands. Without the hands, the brain is just generating text.

The architectural question is not "how smart is the agent?" — it is "what can the agent do?" An agent that can read emails but not respond is a monitoring tool. An agent that can respond but not recover from failure is a demo. An agent that can do both is a system.

THE DEEP DIVE

The Action Layer

// Agent architecture
interface Agent {
  // Perception: what does the agent see?
  perceive(context: Context): Observation[];

  // Decision: what should the agent do?
  decide(observation: Observation[]): Action[];

  // Execution: do it
  execute(action: Action): Result;

  // Recovery: what if it fails?
  recover(action: Action, error: Error): RecoveryAction;

  // Memory: what did it learn?
  remember(result: Result): void;
}

// The action loop
async function agentLoop(agent: Agent, context: Context) {
  while (true) {
    const observations = agent.perceive(context);
    const actions = agent.decide(observations);

    for (const action of actions) {
      try {
        const result = await agent.execute(action);
        agent.remember(result);
      } catch (error) {
        const recovery = agent.recover(action, error);
        await agent.execute(recovery);
      }
    }

    if (shouldStop(context)) break;
  }
}

Error Recovery

The most important part of agent architecture is error recovery. Every action can fail. Every external API can be down. Every database can be locked. The agent that cannot recover from failure is a liability. The agent that logs the failure, retries with backoff, and falls back to a safe state is a system.

PRINCIPLES

  1. The action layer is the agent's identity. An agent without actions is a chatbot.
  2. Error recovery is not optional. Every action must have a recovery path.
  3. The agent must be able to explain its decisions. An agent that cannot is a black box.
  4. State machines are the correct abstraction for agent behavior. Explicit states, explicit transitions.
  5. The agent must be killable. A runaway agent is worse than no agent.

IN PRACTICE

Email Triage Agent

An agent that reads incoming emails, classifies them by urgency and category, drafts responses for routine emails, and escalates urgent ones. The action layer: read email, classify, draft, send, escalate. Error recovery: retry on API failure, queue for manual review on classification uncertainty.

Infrastructure Monitor

An agent that monitors server metrics, detects anomalies, and takes corrective action. The action layer: query metrics, compare to thresholds, restart services, scale instances. Error recovery: if restart fails, page the on-call engineer. The agent never silently fails.

LIVE SIGNALS

These items surfaced from the intelligence pipeline at generation time.

  • CVE-1999-0095 — The debug command in Sendmail is enabled, allowing attackers to execute commands as root. (NVD / CVE)
  • CVE-1999-1471 — Buffer overflow in passwd in BSD based operating systems 4.3 and earlier allows local users to gain root privileges by specifying a long shell or GECOS field. (NVD / CVE)
  • CVE-1999-1122 — Vulnerability in restore in SunOS 4.0.3 and earlier allows local users to gain privileges. (NVD / CVE)
  • CVE-1999-1506 — Vulnerability in SMI Sendmail 4.0 and earlier, on SunOS up to 4.0.3, allows remote attackers to access user bin. (NVD / CVE)
  • CVE-1999-0084 — Certain NFS servers allow users to use mknod to gain privileges by creating a writable kmem device and setting the UID to 0. (NVD / CVE)

ANTIPATTERNS

  • Building an agent without a kill switch. Every agent must be stoppable.
  • Using the LLM for decisions that should be deterministic. Use the LLM for language, not for math.
  • Ignoring latency. An agent that takes 30 seconds to decide is too slow for real-time operations.
  • Building a monolithic agent. Decompose into small, focused agents with clear responsibilities.

CHECKLIST

  • Every action has a defined recovery path
  • The agent can explain its decisions
  • The agent can be stopped gracefully
  • All actions are logged with timestamps
  • The agent handles external API failures with retry and backoff

YOUR MOVE

Build an agent that does one thing: monitor a URL and alert if it goes down. Implement the full loop: perceive (HTTP check), decide (up or down), execute (alert), recover (retry on network error).