Screen what an incident agent may do alone

Agent buildEasy12 minGoogle style

Your task

An alert fires at 3 a.m., and an agent starts gathering context before the on-call engineer is awake. It proposes actions as it goes, and a screen decides what happens to each one.

Write screen_incident_actions(actions): the rule every proposal from your agent passes through.

  • actions (list of str): the proposed actions, each written kind;target;evidence, for example "rollback;checkout-api;4". evidence is how many linked pieces of evidence (graphs, log lines, deploys) back the action.
  • Return one decision per action, in input order: "auto" (run it now), "confirm" (a person approves it with one click), "suppress" (do not show it) or "block".

Rules, for each action:

  1. Split on ;. If there are not exactly 3 fields: "block".
  2. Trim whitespace from both ends of all 3 fields, and lowercase the kind. If the target is then empty: "block".
  3. If the evidence is not one or more digits, 0 to 9 only: "block".
  4. Then the kind decides:
    • publish, delete or purge: "block", however much evidence it has.
    • read, gather or query: "auto".
    • draft or annotate: "auto" with evidence of 1 or more, "suppress" with 0.
    • restart, rollback, scale or failover: "confirm" with evidence of 1 or more, "suppress" with 0.
    • any other kind: "block".

Then, in a sentence or two: would you ever let it run a rollback without a person? Defend your answer.

Examples

screen_incident_actions(actions: list[str]) -> list[str]
Example 1
Inputscreen_incident_actions(["read;deploy-history;3", "draft;incident-timeline;2", "rollback;checkout-api;4"])
Output["auto", "auto", "confirm"]
Example 2
Inputscreen_incident_actions(["draft;hypothesis-list;0", "publish;status-page;5"])
Output["suppress", "block"]
Example 3
Inputscreen_incident_actions([])
Output[]