og.rsts.dev
← writing

You Are the Cron Job

Listen 0:00 / 0:00

My blog factory runs without me, but it still waits for me to paste a link. IndyDevDan's in-, near-, and out-of-the-loop ladder says the next move is to stop being the trigger. Here is what changes when an event wakes the agent instead of a person: the trigger becomes the control, the approval becomes a designed artifact, and near the loop becomes the place most serious work should live.

You Are the Cron Job
Contents

I pasted a link.

That is how my dark-factory post began. I counted three human touches between a URL and a pull request, and I was proud of the number. Two of those touches were judgment: choosing the angle and approving the plan. The first one was something else. Nothing in the factory could start until I showed up and pasted a link. I was the cron job.

The ladder has a middle rung

IndyDevDan put a name on that in “Elite Agentic Engineers Are Leaving the Loop” (opens in new tab). His ladder has three rungs, and he compresses each one into a verb:

  • In the loop: you prompt. You and the terminal. Your attention goes into writing the next instruction.
  • Near the loop: you approve. The agent does the work and comes back for a decision. You click, respond, give feedback.
  • Out of the loop: you observe. Full cron. You are no longer a requirement for the work to happen.

His sharpest claim is that human-triggered agentic coding is “yesterday’s advantage.” Everyone has a coding agent in a terminal now, so sitting in front of one is no longer an edge. The next edge is agents that start from something other than you: a webhook, a schedule, a ticket, a log event. In his words, the agent “does not wait for you to work, it works for you then waits.”

That landed because I checked my own system against it, and the answer was uncomfortable. Every agent that produces something I care about starts from my keystroke or my phone.

The human is the scheduler

Look closely at most “autonomous” agent setups and you will find a person acting as the event bus. The agent is capable. The harness is durable. The tools are wired. And the whole thing sits idle until a human notices something and types a sentence.

My own setup proves the pattern by its exceptions. A few jobs already run without me. At 3 a.m. a scheduled job consolidates what my assistant learned from the day’s sessions. At 4:30 a.m. another one harvests new posts from a set of independent blogs. I am asleep for both, and that is fine, because both of them only read. Neither publishes or merges anything, and neither one touches a system someone else depends on.

The blog factory is different. It writes, and it writes in public. So it waits for me, and I never questioned that, because “a human starts it” felt like the same thing as “a human controls it.”

They are two different things. Pasting the link controls nothing. It is scheduling, and I happen to be the scheduler. The real control lives in the plan approval and the merge, which come later. IndyDevDan’s line for this is blunt: “The thing they need isn’t you. It’s information.” The agent needs to know a topic is worth writing about. Whether a person or a feed brings that information in matters much less than I assumed.

Near the loop is a designed tier

The middle rung is easy to misread as a waiting room, the place you stand while you work up the nerve to go fully out. I think that undersells it. Near the loop is where most serious work should live, and it has to be designed on purpose.

IndyDevDan sketches the flow of a proactive agent as: detect the event, triage, prepare the patch, ask you, apply, verify, save the results. Six of those seven steps happen without you. The one that matters is “ask you,” and the quality of that ask decides whether near the loop is a relief or a new kind of inbox hell.

If the ask is a wall of agent transcript, you are back in the loop, just with worse ergonomics. Approving is not the same as reviewing a diff. A good ask is an artifact built to be decided quickly and correctly:

interface DecisionPacket {
  trigger: { source: string; event: string; id: string; receivedAt: string };
  question: string;        // one question, answerable yes or no
  evidence: string[];      // links to what the agent read, not a summary of it
  proposedAction: string;  // the exact write: the diff, the command, the message
  blastRadius: string;     // who and what this touches if it is wrong
  rollback: string;        // how to undo it, tested, not hoped
  expiresAt: string;       // a stale approval is not an approval
}

Every field closes a gap that a bare “approve?” prompt leaves open. The trigger block is there so you know why this is in front of you at all. evidence holds links instead of prose because a summary is the model grading its own homework. expiresAt is there because “approved on Tuesday” should not authorize a write on Friday against a system that changed on Wednesday.

LangChain’s Harrison Chase made a related point when he introduced ambient agents (opens in new tab), which he defines as agents that “listen to an event stream and act on it accordingly.” He names three ways a human comes back in: notify, question, and review. He also says the quiet part plainly: “Human-in-the-loop lowers the stakes.” That is the real job of the middle rung. It is what lets you ship the agent at all.

The trigger becomes the control

Here is the part the ladder does not say out loud, and the reason this post exists.

While I am the trigger, a lot of security comes for free. The event was authenticated because I logged in. It was authorized because I chose to type it. It is attributed because it came from my session. Nobody can replay me, forge me, or send me twice by accident.

Replace me with a webhook and every one of those properties turns into a question you have to answer in code:

  • Provenance. Who sent this event, and can you prove it?
  • Freshness. Is this the event, or a copy of it from an hour ago?
  • Uniqueness. Did it arrive twice, and will the agent act twice?
  • Content. The payload is text the agent will read. Is that text trying to steer it?

The first three have well-worn answers. The Standard Webhooks spec (opens in new tab) signs the message ID, timestamp, and body together (msg_id.timestamp.payload), checks the timestamp “within some allowable tolerance of the current timestamp to prevent replay attacks,” and recommends the webhook-id header as an idempotency key. In Bun, the receiving side of an agent trigger looks like this:

import { createHmac, timingSafeEqual } from "node:crypto";

const TOLERANCE_SECONDS = 5 * 60;
const seen = new Map<string, number>(); // webhook-id -> expiry; use Redis in production

export function verifyTrigger(headers: Headers, rawBody: string, secret: string) {
  const id = headers.get("webhook-id");
  const ts = Number(headers.get("webhook-timestamp"));
  const signatures = headers.get("webhook-signature") ?? "";
  if (!id || !Number.isInteger(ts)) throw new Error("missing trigger headers");

  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - ts) > TOLERANCE_SECONDS) throw new Error("stale or future trigger");

  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest();
  const valid = signatures.split(" ").some((entry) => {
    const [version, sig] = entry.split(",");
    if (version !== "v1" || !sig) return false;
    const got = Buffer.from(sig, "base64");
    return got.length === expected.length && timingSafeEqual(got, expected);
  });
  if (!valid) throw new Error("bad signature");

  if ((seen.get(id) ?? 0) > now) return { id, duplicate: true };
  seen.set(id, now + TOLERANCE_SECONDS);
  return { id, duplicate: false };
}

None of that is new. Payment providers have done it for years. What is new is the thing behind the endpoint. A classic webhook handler runs fixed code. An agent trigger hands the payload to a model that decides what to do next.

That is why the fourth question is the hard one. The OWASP Top 10 for Agentic Applications (opens in new tab) leads with agent goal hijack, where an attacker redirects an agent’s objective through content it consumes. A ticket body, a log line, or an email subject that wakes an agent is exactly that kind of content. A valid signature proves who sent the event. It says nothing about whether the words inside it are safe to act on.

So when the human stops being the trigger, the trigger has to carry what the human used to carry: an identity, an authorization, and a limit on what it can lead to. That last part is the one most designs skip. In Least Privilege Was for Humans I argued that agents need least agency on behavior, not just least privilege on credentials. Triggers need the same treatment.

Durable, triggered, sandboxed, and gated

IndyDevDan’s recipe for a proactive agent is durable agent plus trigger plus sandbox. Durability I have covered in The Harness Is Becoming the Runtime, and the sandbox is table stakes. I would add a fourth term, and make it the one you write first: the gate.

The gate is a policy that maps each trigger to the most powerful verb it is allowed to lead to. Here is the shape:

type Verb = "read" | "draft" | "write";

interface TriggerRule {
  source: "cron" | "webhook" | "ticket" | "log";
  event: string;
  maxVerb: Verb;   // the most powerful thing this trigger may lead to
  actsAs: string;  // a service identity, never the person who configured it
}

const rules: TriggerRule[] = [
  { source: "cron",    event: "nightly-harvest",     maxVerb: "read",  actsAs: "svc-harvester" },
  { source: "log",     event: "error-rate-spike",    maxVerb: "read",  actsAs: "svc-investigator" },
  { source: "ticket",  event: "dispute-opened",      maxVerb: "draft", actsAs: "svc-case-prep" },
  { source: "webhook", event: "fix-ready-to-deploy", maxVerb: "write", actsAs: "svc-remediator" },
];

const rank: Record<Verb, number> = { read: 0, draft: 1, write: 2 };

export function admit(source: string, event: string, requested: Verb) {
  const rule = rules.find((r) => r.source === source && r.event === event);
  if (!rule) return { decision: "reject" as const };                 // unlisted events wake nothing
  if (rank[requested] > rank[rule.maxVerb]) return { decision: "reject" as const };
  if (requested === "write") return { decision: "decision-packet" as const, actsAs: rule.actsAs };
  return { decision: "run" as const, actsAs: rule.actsAs };
}

Three things in that small table do most of the work. Unlisted events wake nothing, so the default is silence. Reads and drafts run on their own, because a wrong read costs compute and a wrong draft costs a delete. And every write stops near the loop with a decision packet, no matter how trusted the source looks. This is the same split I made for the AI SRE: investigation is a safe yes, and remediation is a write that needs a gate. The trigger policy applies that split before the agent even starts.

The loop ladder with a trigger gate: cron, webhook, ticket, and log events pass signed, fresh, unique, and listed checks; reads and drafts run out of the loop, writes stop near the loop at a decision packet for a human

The experience and the control want the same thing

It is worth slowing down here, because both sides of this have a real case.

Start with the people the work is for. A customer opens a dispute. In the human-triggered world, the case sits in a queue until someone picks it up, reads the history, pulls the transactions, and starts to understand it. In the event-triggered world, the dispute itself wakes an agent. By the time a banker opens the case, the history is assembled, the related transactions are linked, and the likely resolution is drafted with its evidence. The customer waits less. The banker spends their time on the judgment instead of the gathering. That is a real good, and calling it a demo would be dishonest.

Now take the institution’s side, which is also a real good. An always-on agent that wakes on events is a new actor in the estate. Someone has to answer who it is, what woke it, what it was allowed to do, and what it did. The trigger path has to be deterministic, so the same event produces the same admission decision every time. Attribution has to survive the absence of a person: “the agent did it” cannot be the end of the audit trail. And always-on is not free. IndyDevDan warns that today’s “insanely subsidized subscriptions will not last forever.” An agent that wakes on every log line is a bill that grows with your traffic.

Here is how the two reconcile. The control is what lets you say yes to the experience. Because the dispute trigger is listed, signed, deduplicated, capped at draft, and running as a named service identity, you can let it fire on every new case without asking anyone’s permission each time. The gate does not slow the experience down. It is the reason the experience is allowed to exist.

For my own factory, the next step follows directly. The nightly harvest already reads. I can let a scheduled job turn what it finds into three ranked topic candidates, each one a small decision packet: the sources, the angle, why it fits what I have already written. That step reads and drafts, so it can run while I sleep. The write, publishing to the world, stays exactly where it is. I stop being the cron job and keep being the editor.

Where I part ways with the ladder

IndyDevDan claims 80% or more of current work could run without you, given the right system. For my personal lanes, where I own the blast radius, that may be true. For material work in an institution, I think it is the wrong target. Near the loop, done well, is the destination for anything that moves money or touches a customer’s record. The goal is to make the one decision fast and well-informed, not to remove it.

His proposed scorecard, how many agents are working for you right now, also needs a guardrail. He concedes the obvious exploit himself: anyone can spin up a while loop doing random work. A count of busy agents rewards activity. I would rather count the decisions I am still required for each week, and for each one, ask whether I am there as judgment or as a scheduler.

And some of me stays in the loop on purpose. My taste picks the topic in the end. A factory that chooses its own subjects is a different machine from the one I want. All of this is also one builder’s laboratory, not a study.

Judgment or scheduler

IndyDevDan suggests asking one question before every session: is there a reason I’m still in the loop for this work? It is a good question. I would sharpen it.

When you show up to an agent, look at what you are bringing. If it is judgment, you belong there, and the work is to make that moment as clean as a decision packet. If it is just the fact that something happened, you are the cron job. Write the trigger, write the gate, and go do something only you can do.

If this resonated, read I’m Building the Dark Factory, and I Love It for the factory this post is trying to wake up, and Least Privilege Was for Humans for why the trigger needs limits of its own.

Find me on X @orestesgarcia (opens in new tab) or LinkedIn (opens in new tab).