Design an always-on agent that wakes on a schedule or an event, with no user present, and runs until it meets its success criteria or runs out of budget. What identity does it act as, how do you define done, what stops it acting on a stale or poisoned trigger, and how does a human find out what it did overnight?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Scheduled and event-triggered agents are now a product category: agent platforms advertise outcome-driven runs where you give success criteria and a budget and the agent iterates until it gets there, with hard session budgets as a platform feature. The interactive design assumptions break: nobody is there to approve, clarify or notice.
Full worked answer with diagram
Scheduled and event-triggered agents are now a product category: agent platforms advertise outcome-driven runs where you give success criteria and a budget and the agent iterates until it gets there, with hard session budgets as a platform feature. The interactive design assumptions break: nobody is there to approve, clarify or notice.
Job spec, not prompt. Each agent is defined by a versioned spec: the trigger, the task, machine-checkable success criteria, permitted tools and scopes, a budget, and the action classes it may never take unsupervised. The trigger supplies parameters; it never supplies the task.
Identity. The agent runs as its own workload identity, not as a user's session and never with a static API key. If it acts for a user, it holds a delegated, scoped, short-lived token from that user's grant, so audit shows both principals. Credentials live in the runtime, not in the model's context. The IETF WIMSE working group's AI agent identity draft (adopted September 2026) states the same rules: static API keys are an antipattern and the LLM must not have access to the agent's credentials.
Triggers.
- Durable queue with an event id, source and timestamp; dedupe on the id so a redelivered webhook does not run twice.
- A freshness TTL: a trigger older than the job's tolerance is dropped and logged.
- Revalidate at the start: re-read the current state from the source of truth instead of trusting the payload, because the world may have changed since the event.
- Treat event content as untrusted data. An inbound email or ticket that triggers a run is the classic injection vector, and with no human watching, the lethal-trifecta analysis matters more, not less.
- One run per key at a time, with a lock, so two triggers do not race on the same record.
Defining done. Terminal states are explicit: succeeded (criteria verified by a check, not by the agent's claim), budget exhausted, blocked needing a human, or failed. Budgets are hard caps on tokens, cost, wall-clock time and tool calls, enforced by the harness. "Keep trying until it works" without a cap is how an overnight run burns a month's budget.
Supervision without a human present. Actions above a risk threshold (sending externally, spending money, deleting) are queued for morning approval rather than executed. Everything else runs, but sandboxed and logged.
How a human finds out. A run report per job: what triggered it, what it read, what it changed (with diffs), what is waiting for approval, what it cost, and why it stopped. A morning digest across jobs, alerts on anomalies such as a jump in runs, cost or denials, and a kill switch per job and globally.
Worth sketching. Optional, but the revalidation step and the approval queue are what make it safe to leave running.
flowchart TD
A["Schedule or event"] --> B{"Duplicate or<br/>older than TTL?"}
B -->|"yes"| C["Drop and log"]
B -->|"no"| D["Re-read state from<br/>source of truth"]
D --> E["Agent loop within budget"]
E --> F{"Risky action?"}
F -->|"yes"| G["Queue for human approval"]
F -->|"no"| H["Execute in sandbox"]
H --> I["Verify criteria, write run report"]
G --> I
What a good answer covers
- Scheduled and event-triggered agents are now a product category
- The interactive design assumptions break: nobody is there to approve, clarify or notice
- Each agent is defined by a versioned spec
- The trigger supplies parameters; it never supplies the task
- The agent runs as its own workload identity, not as a user's session and never with a static API key
Key terms: Job spec, not prompt · Identity · Triggers · Defining done · Supervision without a human present · How a human finds out
In the glossary: Tool call
Interviewer follow-ups to expect
How would you test a job against a poisoned trigger before enabling it?
What happens to queued approvals that nobody reviews for a week?
How do you stop a misconfigured schedule from launching a thousand runs?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep