---
title: "Work the queue in order of harm and · Agent Wranglers"
url: https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/queue-priority
id: TNS-4
level: Recommended
updated: 2026-10-22
tokens: 1077
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Work the queue in order of harm and deadline

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Reports and queues](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: TNS-4
- Level: Recommended
- Chapter: [Reports and queues](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues.md)
- Rule: Sort open cases by severity first and due time second. Give each severity a target time to decide, and alert when the oldest case in a severity passes it.
- Check: A unit test builds a queue of a spam case from Monday and a threat case from Tuesday, and the threat case comes first. A test case from a listed trusted flagger outranks the same case from a user. An alert fires when a severity 1 case stays open past its target in staging.
- How: A first-in, first-out queue lets spam reports bury a threat. Take the severity from the [policy table](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/policy-table.md) for the worst reason reported. Put threats to life, child safety and authority orders at the top, with targets in minutes or hours. [Act on orders from authorities within their deadline](https://agentwranglers.se/playbook/trust-and-safety/decisions-and-appeals/authority-orders.md) sets the times for orders. Article 22 of the Digital Services Act makes online platforms handle notices from trusted flaggers with priority. National coordinators name those flaggers, so keep their list as data and raise their cases one level. Measure the time from receipt to decision for each severity. Those medians go into the [yearly moderation report](https://agentwranglers.se/playbook/compliance/online-platforms/moderation-report.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const TARGET_MINUTES = { 1: 60, 2: 24 * 60, 3: 72 * 60 };

export const compareCases = (a, b) => a.severity - b.severity || Date.parse(a.dueAt) - Date.parse(b.dueAt);

export const overdue = (cases, now = Date.now()) =>
  cases.filter(c => now - Date.parse(c.openedAt) > TARGET_MINUTES[c.severity] * 60_000);
```

### Python example

```python
from datetime import datetime, timedelta, timezone

TARGET = {1: timedelta(hours=1), 2: timedelta(days=1), 3: timedelta(days=3)}

def case_order(case: dict) -> tuple:
    return (case["severity"], case["due_at"])

def overdue(cases: list[dict], now: datetime | None = None) -> list[dict]:
    now = now or datetime.now(timezone.utc)
    return [c for c in cases if now - c["opened_at"] > TARGET[c["severity"]]]
```

## Sources

- [Digital Services Act Article 22](https://eur-lex.europa.eu/eli/reg/2022/2065/oj)

## Related rules

- TNS-2 [Write the moderation policy as one table of reasons and actions](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/policy-table.md) in Trust and safety
- TNS-6 [Act on orders from authorities within their deadline](https://agentwranglers.se/playbook/trust-and-safety/decisions-and-appeals/authority-orders.md) in Trust and safety
- CMP-65 [Publish a yearly moderation report](https://agentwranglers.se/playbook/compliance/online-platforms/moderation-report.md) in Compliance and governance

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/queue-priority">Agent Wranglers trust and safety playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Gather every report and flag in one queue](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/one-moderation-queue.md)
- Next: [Limit what moderators must see of harmful content](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/moderator-exposure.md)
- [Reports and queues](https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues.md)
