Agent Wranglers

Scope and ownership Required

Derive scope from recorded facts

Store the facts that decide which laws apply, such as headcount, turnover, countries served and product types, and compute each threshold in code.

How to do it

Keep a small facts file next to the register. Write each threshold as a named function with a link to the article it comes from. The EU size test in Recommendation 2003/361 is a common one. A company stops being small at 50 staff, or when both turnover and balance sheet pass 10 million euros. NIS2 uses that line. Count staff and money of partner and linked companies too, as the Recommendation says. A status changes only after the line is crossed in two years in a row. When a function's answer differs from the register, the build fails, so a change in facts forces a new decision.

Example

export const isSmallEnterprise = ({ staff, turnoverEur, balanceSheetEur }) =>
  staff < 50 && (turnoverEur <= 10_000_000 || balanceSheetEur <= 10_000_000);
def is_small_enterprise(staff: int, turnover_eur: int, balance_sheet_eur: int) -> bool:
    return staff < 50 and (turnover_eur <= 10_000_000 or balance_sheet_eur <= 10_000_000)

How to check

A unit test sets headcount to 50 for one year in a copy of the facts file, and the size stays small. With 50 for two years in a row, the size changes from small to medium. The register check then fails until the NIS2 entry is updated.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers compliance playbook: https://agentwranglers.se/playbook/compliance/scope-and-ownership/scope-from-facts.