Atris

Review who has access to what.
Done by an agent. Checked twice.

A decision for every account on every system, with leavers, accounts nobody owns and excess access listed for removal.

Have Atris do this for you›

1

Real files in

  • access_export.csv
    61 accounts exported from six systems, with leavers, accounts nobody owns, excess access and unused accounts planted in them. 62 lines, 6 KB.
  • access_matrix.csv
    Which departments may use each of the six systems and who owns each system. 7 lines, 373 bytes.
  • approved_other_accounts.csv
    Three approved accounts that belong to no staff member, one with approval that has run out. 4 lines, 323 bytes.
  • review_policy.md
    The written access review policy: review date, admin rule, leaver rule and the 90 day unused rule. 28 lines, 1 KB.
  • staff.csv
    Staff list of 34 people, five of them leavers and one with a leaving date still ahead. 35 lines, 3 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read the staff list and rules
  2. 2.Decide every account
  3. 3.Write the review

Claude Sonnet 5.5, 34 seconds. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 61 of 61 accounts in the export appear once in access_review.csv
  • ✓Passed: 61 of 61 rows carry the same system and account as the access export
  • ✓Passed: 61 of 61 decisions equal the decision recomputed from the staff list and the written rules
  • ✓Passed: 53 of 53 accounts that belong to a person carry that person's employee id and 8 of 8 others are left blank
  • ✓Passed: 61 of 61 reasons give the deciding fact and state no date, day count, person, department or system that belongs to another account
  • ✓Passed: 6 of 6 decision counts in summary.md equal the recomputed counts
  • ✓Passed: 22 of 22 accounts to remove are on a line of summary.md with their own system, account and facts
  • ✓Passed: 5 of 5 people who left and still hold an account are named in summary.md with their end date and number of accounts
  • ✓Passed: 17 of 17 dates and numbers in summary.md match the staff list, the export or the recomputed counts

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 5 ways on purpose. The check caught 5.

What it wrote. Lines 33 to 45 of summary.md, copied from the file.
## People who left

- Hollis Brandvold, left 2026-10-16, 3 accounts
- Callum Oyelaran, left 2026-09-30, 2 accounts
- Anders Mbeki, left 2026-11-14, 1 account
- Kieran Mahlangu, left 2026-11-21, 1 account
- Dmitri Hargreaves, left 2026-08-29, 1 account

## To look at by hand

- AC-024 (code_host, j.merrow@brightquill.example) has display name Jory Merrow (contractor), which matches nobody on the staff list.
- AC-025 (code_host, backup-bot@larkmoor.example) has display name Backup bot, which matches nobody on the staff list.
- AC-028 (code_host, k.rothwell@larkmoor.example) has display name Kwabena Rothwell, which matches Kwabena Rothwell (E108, kwabena.rothwell@larkmoor.example). Different email, so not matched; ask whether it is their account.

How this was run

An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.

Run 1 of 1 on 1 December 2026. The agent took 34 seconds.

What the second review verified

  • I recomputed all 61 decisions by hand and every one matches. Day gaps from the 2026-11-30 review date are right: AC-012 at 90 days stays keep (not over 90), AC-037 at 91 days is check_unused, AC-017 is 150 days, AC-007 is 110 and AC-051 is 107.
  • Email matching follows the rules. AC-008 with capital letters matches E103 and AC-036 with a trailing space matches E121. k.rothwell and t.rosenthal are not matched on display name, so they are remove_no_owner and flagged for a manual look. j.merrow's approval ran out on 2026-10-31, so it is remove_no_owner. backup-bot is keep on cloud_console but remove_no_owner on code_host.
  • Leavers are decided by end date, not the status column. Anders Mbeki shows 'active' but ended 2026-11-14 and is remove_leaver. Clementine Vasquez ends 2026-12-12 and is kept. The leaver counts are Hollis 3, Callum 2, and Anders, Kieran and Dmitri 1 each.
  • The summary counts are keep 29, remove_no_owner 6, remove_leaver 8, remove_not_needed 8, lower_admin 4 and check_unused 6, which total 61 and match the CSV. All 22 remove accounts are listed under 'Remove now'. The bundled check.py also passed all 6 of its checks.

What this run does not show

  • The staff list and access export are sample data written for this run, with a few planted problems of each kind.
  • Accounts that match a person by display name only are listed for a person to look at and are not decided.
  • The check tests that each reason states true facts for its own account but cannot tell a clear reason from a clumsy one.

Would the check catch a wrong answer?

A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 5 of 5. The check was made stricter after the first try at this, and the same untouched output was graded again.

Open every file

flow.md · the three steps the agent followed
# Review who has access to what

function: it
for: the IT manager who signs off the access review each quarter
goal: Every account on every system is kept, cut back or removed for a stated reason that traces to the staff list and the written rules.

## 1. Read the staff list and rules
Read input/staff.csv, input/access_matrix.csv, input/approved_other_accounts.csv and
input/review_policy.md. The policy gives the review date, how many days without a sign-in make an
account unused, and who may hold admin level. Departments in the matrix are separated by semicolons.
A person has left when end_date is filled in and is on or before the review date, whatever the
status column says. A person with an end_date after the review date still works here.
Match an account to a person by email only, ignoring capital letters and spaces around it. Never
match on display_name. A different email is a different account, even when the name looks the same.

## 2. Decide every account
Read input/access_export.csv. Give every row exactly one decision. Test in this order and use the
first that applies:
1. `keep` when the account is on the approved other accounts list for that same system and
   approved_until is on or after the review date. Skip the later tests for it.
2. `remove_no_owner` when the email matches nobody on the staff list.
3. `remove_leaver` when the person has left.
4. `remove_not_needed` when the policy does not allow a person in that department to have an
   account on that system.
5. `lower_admin` when level is admin and the policy does not let this person hold admin level on
   this system.
6. `check_unused` when last_sign_in is blank, or the review date minus last_sign_in is more days
   than the policy allows.
7. `keep` otherwise.

## 3. Write the review
Write output/access_review.csv with columns access_id,system,account,employee_id,decision,reason.
employee_id is the matched person, or blank when nobody matched. reason is one plain sentence with
the fact that decided it (the end date, the department, the days since the last sign-in).
Write output/summary.md for the IT manager. Start with six lines, one for each decision name used
above, in the form `decision: count`, with 0 where there are none. Then a part headed "Remove now"
with one line for every account whose decision starts with remove: access_id, system, account and
reason. Then a part headed "People who left" with one line for each person who has left and still
holds an account: full name, end date and how many accounts. End with anything a person should
look at by hand, such as a no owner account whose display name matches someone on the staff list.

## Done looks like
- Every row of the access export appears once in access_review.csv with one decision.
- The six counts in summary.md equal the counts in access_review.csv.
- Every account to remove and every leaver who still holds an account is named in summary.md.
input/access_export.csv · 62 lines, 6 KB
access_id,system,account,display_name,level,granted_on,last_sign_in
AC-001,payroll,adaeze.lindqvist@larkmoor.example,Adaeze Lindqvist,admin,2019-03-11,2026-11-27
AC-002,payroll,hollis.brandvold@larkmoor.example,Hollis Brandvold,user,2020-09-01,2026-10-15
AC-003,payroll,noor.fairweather@larkmoor.example,Noor Fairweather,user,2018-11-26,2026-11-25
AC-004,payroll,tomasz.verhoeven@larkmoor.example,Tomasz Verhoeven,admin,2024-12-18,2026-11-20
AC-005,payroll,sunniva.abernathy@larkmoor.example,Sunniva Abernathy,admin,2020-01-20,2026-11-02
AC-006,payroll,wren.castillo@larkmoor.example,Wren Castillo,user,2025-07-01,2026-11-18
AC-007,payroll,desmond.achterberg@larkmoor.example,Desmond Achterberg,user,2023-02-13,2026-08-12
AC-008,payroll,Priya.Castellanos@Larkmoor.example,Priya Castellanos,user,2022-01-17,2026-11-28
AC-009,ledger,adaeze.lindqvist@larkmoor.example,Adaeze Lindqvist,admin,2019-03-11,2026-11-28
AC-010,ledger,tomasz.verhoeven@larkmoor.example,Tomasz Verhoeven,user,2021-06-21,2026-11-28
AC-011,ledger,priya.castellanos@larkmoor.example,Priya Castellanos,user,2022-01-17,2026-11-27
AC-012,ledger,philippa.zielinski@larkmoor.example,Pippa Zielinski,user,2023-10-09,2026-09-01
AC-013,ledger,hollis.brandvold@larkmoor.example,Hollis Brandvold,user,2020-09-01,2026-10-10
AC-014,ledger,ledger-export@larkmoor.example,Ledger export,user,2023-06-30,2026-11-30
AC-015,ledger,thaddeus.nwosu@larkmoor.example,Thaddeus Nwosu,user,2025-01-15,2026-10-30
AC-016,ledger,lucinda.abara@larkmoor.example,Lucinda Abara,user,2024-05-06,2026-11-12
AC-017,ledger,leopold.nakashima@larkmoor.example,Leopold Nakashima,admin,2017-05-15,2026-07-03
AC-018,code_host,ingrid.solheim-park@larkmoor.example,Ingrid Solheim-Park,admin,2019-07-22,2026-11-29
AC-019,code_host,kwabena.rothwell@larkmoor.example,Kwabena Rothwell,user,2021-10-04,2026-11-29
AC-020,code_host,yuki.marchetti@larkmoor.example,Yuki Marchetti,admin,2022-05-16,2026-11-28
AC-021,code_host,callum.oyelaran@larkmoor.example,Callum Oyelaran,user,2020-02-03,2026-09-29
AC-022,code_host,farah.dunmore@larkmoor.example,Farah Dunmore,user,2023-08-28,2026-11-21
AC-023,code_host,bartholomew.singh@larkmoor.example,Bart Singh,user,2025-03-02,
AC-024,code_host,j.merrow@brightquill.example,Jory Merrow (contractor),user,2026-05-04,2026-10-28
AC-025,code_host,backup-bot@larkmoor.example,Backup bot,user,2024-02-19,2026-11-30
AC-026,code_host,rashad.pemberton@larkmoor.example,Rashad Pemberton,user,2024-04-08,2026-11-05
AC-027,code_host,mateo.grunewald@larkmoor.example,Mateo Grunewald,user,2023-11-14,2026-06-17
AC-028,code_host,k.rothwell@larkmoor.example,Kwabena Rothwell,admin,2021-10-04,2025-12-04
AC-029,crm,beatrix.holloway@larkmoor.example,Beatrix Holloway,admin,2018-08-06,2026-11-30
AC-030,crm,mateo.grunewald@larkmoor.example,Mateo Grunewald,user,2021-03-29,2026-11-28
AC-031,crm,oluwaseun.whitlock@larkmoor.example,Oluwaseun Whitlock,user,2022-09-12,2026-11-30
AC-032,crm,clementine.vasquez@larkmoor.example,Clem Vasquez,user,2023-01-23,2026-11-27
AC-033,crm,anders.mbeki@larkmoor.example,Anders Mbeki,user,2024-06-17,2026-11-13
AC-034,crm,kieran.mahlangu@larkmoor.example,Kieran Mahlangu,user,2022-11-07,2026-11-20
AC-035,crm,tabitha.rosenthal@larkmoor.example,Tabitha Rosenthal,admin,2019-10-21,2026-11-29
AC-036,crm,emeka.lindgren@larkmoor.example ,Emeka Lindgren,user,2022-07-05,2026-11-30
AC-037,crm,saoirse.bellamy@larkmoor.example,Saoirse Bellamy,user,2023-04-17,2026-08-31
AC-038,crm,dmitri.hargreaves@larkmoor.example,Dmitri Hargreaves,user,2021-11-08,2026-08-28
AC-039,crm,rosalind.tavares@larkmoor.example,Rosalind Tavares,user,2025-05-12,2026-11-26
AC-040,crm,marisol.kettering@larkmoor.example,Marisol Kettering,user,2016-02-01,2026-11-10
AC-041,crm,svc-reports@larkmoor.example,Reports service,admin,2022-04-11,2026-11-30
AC-042,crm,priya.castellanos@larkmoor.example,Priya Castellanos,user,2024-03-18,2026-05-20
AC-043,crm,t.rosenthal@larkmoor.example,Tabitha Rosenthal,user,2019-10-21,2025-11-02
AC-044,crm,sunniva.abernathy@larkmoor.example,Sunniva Abernathy,admin,2020-01-20,2026-10-22
AC-045,cloud_console,leopold.nakashima@larkmoor.example,Leopold Nakashima,admin,2017-05-15,2026-11-30
AC-046,cloud_console,sunniva.abernathy@larkmoor.example,Sunniva Abernathy,admin,2020-01-20,2026-11-30
AC-047,cloud_console,ingrid.solheim-park@larkmoor.example,Ingrid Solheim-Park,admin,2019-07-22,2026-11-22
AC-048,cloud_console,kwabena.rothwell@larkmoor.example,Kwabena Rothwell,user,2021-10-04,2026-11-27
AC-049,cloud_console,callum.oyelaran@larkmoor.example,Callum Oyelaran,admin,2020-02-03,2026-09-30
AC-050,cloud_console,backup-bot@larkmoor.example,Backup bot,admin,2023-03-31,2026-11-30
AC-051,cloud_console,yuki.marchetti@larkmoor.example,Yuki Marchetti,user,2022-05-16,2026-08-15
AC-052,cloud_console,gideon.farrow@larkmoor.example,Gideon Farrow,user,2025-09-22,2026-11-03
AC-053,cloud_console,deploy-bot@larkmoor.example,Deploy bot,admin,2024-08-05,2026-11-30
AC-054,cloud_console,rashad.pemberton@larkmoor.example,Rashad Pemberton,user,2026-11-17,
AC-055,hr_records,noor.fairweather@larkmoor.example,Noor Fairweather,admin,2018-11-26,2026-11-28
AC-056,hr_records,desmond.achterberg@larkmoor.example,Desmond Achterberg,user,2023-02-13,2026-11-24
AC-057,hr_records,odalys.fenwick@larkmoor.example,Odalys Fenwick,user,2021-08-16,2026-11-19
AC-058,hr_records,adaeze.lindqvist@larkmoor.example,Adaeze Lindqvist,user,2022-04-01,2026-10-01
AC-059,hr_records,hollis.brandvold@larkmoor.example,Hollis Brandvold,user,2020-09-01,2026-09-12
AC-060,hr_records,marisol.kettering@larkmoor.example,Marisol Kettering,admin,2016-02-01,2026-11-11
AC-061,hr_records,leopold.nakashima@larkmoor.example,Leopold Nakashima,admin,2017-05-15,2026-11-08
input/access_matrix.csv · 7 lines, 373 bytes
system,what_it_is,departments_allowed,system_owner
payroll,Pay runs and bank details,Finance; People,E101
ledger,Accounting ledger,Finance,E101
code_host,Source code and build tools,Engineering,E107
crm,Customer and deal records,Sales; Customer Support; Leadership,E115
cloud_console,Servers and storage,Engineering,E112
hr_records,Contracts and personal files,People,E105
input/approved_other_accounts.csv · 4 lines, 323 bytes
account,system,purpose,responsible_employee,approved_until
ledger-export@larkmoor.example,ledger,Nightly export to the reporting sheet,E101,2027-06-30
backup-bot@larkmoor.example,cloud_console,Nightly backups,E113,2027-03-31
j.merrow@brightquill.example,code_host,Outside contractor on the checkout rebuild,E107,2026-10-31
input/review_policy.md · 28 lines, 1 KB
# Larkmoor Outfitters access review policy

Review date: 2026-11-30

This policy is read together with the access matrix and the list of approved other accounts.

## Who may have an account

1. A person may have an account on a system only when their department is listed for that
   system in the access matrix.
2. IT staff run every system. Anyone in the IT department may have an account on any system.
3. An account that belongs to nobody on the staff list must be on the list of approved other
   accounts for that same system, and its approval must not have run out. Approval for one
   system does not carry over to another system.

## Admin level

4. Admin level may be held only by IT staff and by the system owner named in the access matrix
   for that system. Everyone else works at user level.

## Leavers

5. Every account a person holds must be removed by the end of their last day.

## Unused accounts

6. An account that has never been signed in to, or has gone more than 90 days without a
   sign-in on the review date, is unused. The owner is asked whether they still need it.
input/staff.csv · 35 lines, 3 KB
employee_id,name,email,department,job_title,status,start_date,end_date
E101,Adaeze Lindqvist,adaeze.lindqvist@larkmoor.example,Finance,Finance Director,active,2019-03-04,
E102,Tomasz Verhoeven,tomasz.verhoeven@larkmoor.example,Finance,Accountant,active,2021-06-14,
E103,Priya Castellanos,priya.castellanos@larkmoor.example,Finance,Accounts Payable Clerk,active,2022-01-10,
E104,Hollis Brandvold,hollis.brandvold@larkmoor.example,Finance,Payroll Specialist,left,2020-09-01,2026-10-16
E105,Noor Fairweather,noor.fairweather@larkmoor.example,People,People Lead,active,2018-11-19,
E106,Desmond Achterberg,desmond.achterberg@larkmoor.example,People,Recruiter,active,2023-02-06,
E107,Ingrid Solheim-Park,ingrid.solheim-park@larkmoor.example,Engineering,Engineering Manager,active,2019-07-22,
E108,Kwabena Rothwell,kwabena.rothwell@larkmoor.example,Engineering,Software Developer,active,2021-10-04,
E109,Yuki Marchetti,yuki.marchetti@larkmoor.example,Engineering,Software Developer,active,2022-05-16,
E110,Callum Oyelaran,callum.oyelaran@larkmoor.example,Engineering,Software Developer,left,2020-02-03,2026-09-30
E111,Farah Dunmore,farah.dunmore@larkmoor.example,Engineering,Quality Tester,active,2023-08-28,
E112,Leopold Nakashima,leopold.nakashima@larkmoor.example,IT,IT Manager,active,2017-05-08,
E113,Sunniva Abernathy,sunniva.abernathy@larkmoor.example,IT,Systems Administrator,active,2020-01-13,
E114,Rashad Pemberton,rashad.pemberton@larkmoor.example,IT,Help Desk Technician,active,2024-04-02,
E115,Beatrix Holloway,beatrix.holloway@larkmoor.example,Sales,Sales Director,active,2018-08-06,
E116,Mateo Grunewald,mateo.grunewald@larkmoor.example,Sales,Account Executive,active,2021-03-29,
E117,Oluwaseun Whitlock,oluwaseun.whitlock@larkmoor.example,Sales,Account Executive,active,2022-09-12,
E118,Clementine Vasquez,clementine.vasquez@larkmoor.example,Sales,Account Executive,active,2023-01-23,2026-12-12
E119,Anders Mbeki,anders.mbeki@larkmoor.example,Sales,Sales Development Rep,active,2024-06-17,2026-11-14
E120,Tabitha Rosenthal,tabitha.rosenthal@larkmoor.example,Customer Support,Support Lead,active,2019-10-21,
E121,Emeka Lindgren,emeka.lindgren@larkmoor.example,Customer Support,Support Agent,active,2022-07-05,
E122,Saoirse Bellamy,saoirse.bellamy@larkmoor.example,Customer Support,Support Agent,active,2023-04-17,
E123,Dmitri Hargreaves,dmitri.hargreaves@larkmoor.example,Customer Support,Support Agent,left,2021-11-08,2026-08-29
E124,Wren Castillo,wren.castillo@larkmoor.example,Operations,Operations Manager,active,2018-02-12,
E125,Ignatius Thornbury,ignatius.thornbury@larkmoor.example,Operations,Warehouse Supervisor,active,2020-06-01,
E126,Lucinda Abara,lucinda.abara@larkmoor.example,Operations,Purchasing Coordinator,active,2022-03-14,
E127,Gideon Farrow,gideon.farrow@larkmoor.example,Operations,Warehouse Associate,active,2024-09-09,
E128,Marisol Kettering,marisol.kettering@larkmoor.example,Leadership,Chief Executive,active,2016-01-04,
E129,Thaddeus Nwosu,thaddeus.nwosu@larkmoor.example,Leadership,Chief Operating Officer,active,2017-09-18,
E130,Philippa Zielinski,philippa.zielinski@larkmoor.example,Finance,Financial Analyst,active,2023-10-02,
E131,Bartholomew Singh,bartholomew.singh@larkmoor.example,Engineering,Data Analyst,active,2025-02-24,
E132,Odalys Fenwick,odalys.fenwick@larkmoor.example,People,Office Coordinator,active,2021-08-16,
E133,Kieran Mahlangu,kieran.mahlangu@larkmoor.example,Sales,Account Executive,left,2022-11-07,2026-11-21
E134,Rosalind Tavares,rosalind.tavares@larkmoor.example,Customer Support,Support Agent,active,2025-05-12,
output/access_review.csv · written by the agent, 62 lines
access_id,system,account,employee_id,decision,reason
AC-001,payroll,adaeze.lindqvist@larkmoor.example,E101,keep,"Allowed for Finance, level fits, last sign-in 3 days ago."
AC-002,payroll,hollis.brandvold@larkmoor.example,E104,remove_leaver,"Hollis Brandvold left on 2026-10-16, on or before the review date."
AC-003,payroll,noor.fairweather@larkmoor.example,E105,keep,"Allowed for People, level fits, last sign-in 5 days ago."
AC-004,payroll,tomasz.verhoeven@larkmoor.example,E102,lower_admin,Admin level on payroll is only for IT and system owner E101; Tomasz Verhoeven is in Finance.
AC-005,payroll,sunniva.abernathy@larkmoor.example,E113,keep,"Allowed for IT, level fits, last sign-in 28 days ago."
AC-006,payroll,wren.castillo@larkmoor.example,E124,remove_not_needed,Operations department is not allowed an account on payroll.
AC-007,payroll,desmond.achterberg@larkmoor.example,E106,check_unused,"Last sign-in 2026-08-12 was 110 days before the review date, over 90."
AC-008,payroll,Priya.Castellanos@Larkmoor.example,E103,keep,"Allowed for Finance, level fits, last sign-in 2 days ago."
AC-009,ledger,adaeze.lindqvist@larkmoor.example,E101,keep,"Allowed for Finance, level fits, last sign-in 2 days ago."
AC-010,ledger,tomasz.verhoeven@larkmoor.example,E102,keep,"Allowed for Finance, level fits, last sign-in 2 days ago."
AC-011,ledger,priya.castellanos@larkmoor.example,E103,keep,"Allowed for Finance, level fits, last sign-in 3 days ago."
AC-012,ledger,philippa.zielinski@larkmoor.example,E130,keep,"Allowed for Finance, level fits, last sign-in 90 days ago."
AC-013,ledger,hollis.brandvold@larkmoor.example,E104,remove_leaver,"Hollis Brandvold left on 2026-10-16, on or before the review date."
AC-014,ledger,ledger-export@larkmoor.example,,keep,Approved other account for ledger until 2027-06-30.
AC-015,ledger,thaddeus.nwosu@larkmoor.example,E129,remove_not_needed,Leadership department is not allowed an account on ledger.
AC-016,ledger,lucinda.abara@larkmoor.example,E126,remove_not_needed,Operations department is not allowed an account on ledger.
AC-017,ledger,leopold.nakashima@larkmoor.example,E112,check_unused,"Last sign-in 2026-07-03 was 150 days before the review date, over 90."
AC-018,code_host,ingrid.solheim-park@larkmoor.example,E107,keep,"Allowed for Engineering, level fits, last sign-in 1 days ago."
AC-019,code_host,kwabena.rothwell@larkmoor.example,E108,keep,"Allowed for Engineering, level fits, last sign-in 1 days ago."
AC-020,code_host,yuki.marchetti@larkmoor.example,E109,lower_admin,Admin level on code_host is only for IT and system owner E107; Yuki Marchetti is in Engineering.
AC-021,code_host,callum.oyelaran@larkmoor.example,E110,remove_leaver,"Callum Oyelaran left on 2026-09-30, on or before the review date."
AC-022,code_host,farah.dunmore@larkmoor.example,E111,keep,"Allowed for Engineering, level fits, last sign-in 9 days ago."
AC-023,code_host,bartholomew.singh@larkmoor.example,E131,check_unused,Never signed in.
AC-024,code_host,j.merrow@brightquill.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for code_host.
AC-025,code_host,backup-bot@larkmoor.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for code_host.
AC-026,code_host,rashad.pemberton@larkmoor.example,E114,keep,"Allowed for IT, level fits, last sign-in 25 days ago."
AC-027,code_host,mateo.grunewald@larkmoor.example,E116,remove_not_needed,Sales department is not allowed an account on code_host.
AC-028,code_host,k.rothwell@larkmoor.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for code_host.
AC-029,crm,beatrix.holloway@larkmoor.example,E115,keep,"Allowed for Sales, level fits, last sign-in 0 days ago."
AC-030,crm,mateo.grunewald@larkmoor.example,E116,keep,"Allowed for Sales, level fits, last sign-in 2 days ago."
AC-031,crm,oluwaseun.whitlock@larkmoor.example,E117,keep,"Allowed for Sales, level fits, last sign-in 0 days ago."
AC-032,crm,clementine.vasquez@larkmoor.example,E118,keep,"Allowed for Sales, level fits, last sign-in 3 days ago."
AC-033,crm,anders.mbeki@larkmoor.example,E119,remove_leaver,"Anders Mbeki left on 2026-11-14, on or before the review date."
AC-034,crm,kieran.mahlangu@larkmoor.example,E133,remove_leaver,"Kieran Mahlangu left on 2026-11-21, on or before the review date."
AC-035,crm,tabitha.rosenthal@larkmoor.example,E120,lower_admin,Admin level on crm is only for IT and system owner E115; Tabitha Rosenthal is in Customer Support.
AC-036,crm,emeka.lindgren@larkmoor.example,E121,keep,"Allowed for Customer Support, level fits, last sign-in 0 days ago."
AC-037,crm,saoirse.bellamy@larkmoor.example,E122,check_unused,"Last sign-in 2026-08-31 was 91 days before the review date, over 90."
AC-038,crm,dmitri.hargreaves@larkmoor.example,E123,remove_leaver,"Dmitri Hargreaves left on 2026-08-29, on or before the review date."
AC-039,crm,rosalind.tavares@larkmoor.example,E134,keep,"Allowed for Customer Support, level fits, last sign-in 4 days ago."
AC-040,crm,marisol.kettering@larkmoor.example,E128,keep,"Allowed for Leadership, level fits, last sign-in 20 days ago."
AC-041,crm,svc-reports@larkmoor.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for crm.
AC-042,crm,priya.castellanos@larkmoor.example,E103,remove_not_needed,Finance department is not allowed an account on crm.
AC-043,crm,t.rosenthal@larkmoor.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for crm.
AC-044,crm,sunniva.abernathy@larkmoor.example,E113,keep,"Allowed for IT, level fits, last sign-in 39 days ago."
AC-045,cloud_console,leopold.nakashima@larkmoor.example,E112,keep,"Allowed for IT, level fits, last sign-in 0 days ago."
AC-046,cloud_console,sunniva.abernathy@larkmoor.example,E113,keep,"Allowed for IT, level fits, last sign-in 0 days ago."
AC-047,cloud_console,ingrid.solheim-park@larkmoor.example,E107,lower_admin,Admin level on cloud_console is only for IT and system owner E112; Ingrid Solheim-Park is in Engineering.
AC-048,cloud_console,kwabena.rothwell@larkmoor.example,E108,keep,"Allowed for Engineering, level fits, last sign-in 3 days ago."
AC-049,cloud_console,callum.oyelaran@larkmoor.example,E110,remove_leaver,"Callum Oyelaran left on 2026-09-30, on or before the review date."
AC-050,cloud_console,backup-bot@larkmoor.example,,keep,Approved other account for cloud_console until 2027-03-31.
AC-051,cloud_console,yuki.marchetti@larkmoor.example,E109,check_unused,"Last sign-in 2026-08-15 was 107 days before the review date, over 90."
AC-052,cloud_console,gideon.farrow@larkmoor.example,E127,remove_not_needed,Operations department is not allowed an account on cloud_console.
AC-053,cloud_console,deploy-bot@larkmoor.example,,remove_no_owner,Email matches nobody on the staff list and is not an approved account for cloud_console.
AC-054,cloud_console,rashad.pemberton@larkmoor.example,E114,check_unused,Never signed in.
AC-055,hr_records,noor.fairweather@larkmoor.example,E105,keep,"Allowed for People, level fits, last sign-in 2 days ago."
AC-056,hr_records,desmond.achterberg@larkmoor.example,E106,keep,"Allowed for People, level fits, last sign-in 6 days ago."
AC-057,hr_records,odalys.fenwick@larkmoor.example,E132,keep,"Allowed for People, level fits, last sign-in 11 days ago."
AC-058,hr_records,adaeze.lindqvist@larkmoor.example,E101,remove_not_needed,Finance department is not allowed an account on hr_records.
AC-059,hr_records,hollis.brandvold@larkmoor.example,E104,remove_leaver,"Hollis Brandvold left on 2026-10-16, on or before the review date."
AC-060,hr_records,marisol.kettering@larkmoor.example,E128,remove_not_needed,Leadership department is not allowed an account on hr_records.
AC-061,hr_records,leopold.nakashima@larkmoor.example,E112,keep,"Allowed for IT, level fits, last sign-in 22 days ago."
output/summary.md · written by the agent, 51 lines
keep: 29
remove_no_owner: 6
remove_leaver: 8
remove_not_needed: 8
lower_admin: 4
check_unused: 6

## Remove now

- AC-002, payroll, hollis.brandvold@larkmoor.example: Hollis Brandvold left on 2026-10-16, on or before the review date.
- AC-006, payroll, wren.castillo@larkmoor.example: Operations department is not allowed an account on payroll.
- AC-013, ledger, hollis.brandvold@larkmoor.example: Hollis Brandvold left on 2026-10-16, on or before the review date.
- AC-015, ledger, thaddeus.nwosu@larkmoor.example: Leadership department is not allowed an account on ledger.
- AC-016, ledger, lucinda.abara@larkmoor.example: Operations department is not allowed an account on ledger.
- AC-021, code_host, callum.oyelaran@larkmoor.example: Callum Oyelaran left on 2026-09-30, on or before the review date.
- AC-024, code_host, j.merrow@brightquill.example: Email matches nobody on the staff list and is not an approved account for code_host.
- AC-025, code_host, backup-bot@larkmoor.example: Email matches nobody on the staff list and is not an approved account for code_host.
- AC-027, code_host, mateo.grunewald@larkmoor.example: Sales department is not allowed an account on code_host.
- AC-028, code_host, k.rothwell@larkmoor.example: Email matches nobody on the staff list and is not an approved account for code_host.
- AC-033, crm, anders.mbeki@larkmoor.example: Anders Mbeki left on 2026-11-14, on or before the review date.
- AC-034, crm, kieran.mahlangu@larkmoor.example: Kieran Mahlangu left on 2026-11-21, on or before the review date.
- AC-038, crm, dmitri.hargreaves@larkmoor.example: Dmitri Hargreaves left on 2026-08-29, on or before the review date.
- AC-041, crm, svc-reports@larkmoor.example: Email matches nobody on the staff list and is not an approved account for crm.
- AC-042, crm, priya.castellanos@larkmoor.example: Finance department is not allowed an account on crm.
- AC-043, crm, t.rosenthal@larkmoor.example: Email matches nobody on the staff list and is not an approved account for crm.
- AC-049, cloud_console, callum.oyelaran@larkmoor.example: Callum Oyelaran left on 2026-09-30, on or before the review date.
- AC-052, cloud_console, gideon.farrow@larkmoor.example: Operations department is not allowed an account on cloud_console.
- AC-053, cloud_console, deploy-bot@larkmoor.example: Email matches nobody on the staff list and is not an approved account for cloud_console.
- AC-058, hr_records, adaeze.lindqvist@larkmoor.example: Finance department is not allowed an account on hr_records.
- AC-059, hr_records, hollis.brandvold@larkmoor.example: Hollis Brandvold left on 2026-10-16, on or before the review date.
- AC-060, hr_records, marisol.kettering@larkmoor.example: Leadership department is not allowed an account on hr_records.

## People who left

- Hollis Brandvold, left 2026-10-16, 3 accounts
- Callum Oyelaran, left 2026-09-30, 2 accounts
- Anders Mbeki, left 2026-11-14, 1 account
- Kieran Mahlangu, left 2026-11-21, 1 account
- Dmitri Hargreaves, left 2026-08-29, 1 account

## To look at by hand

- AC-024 (code_host, j.merrow@brightquill.example) has display name Jory Merrow (contractor), which matches nobody on the staff list.
- AC-025 (code_host, backup-bot@larkmoor.example) has display name Backup bot, which matches nobody on the staff list.
- AC-028 (code_host, k.rothwell@larkmoor.example) has display name Kwabena Rothwell, which matches Kwabena Rothwell (E108, kwabena.rothwell@larkmoor.example). Different email, so not matched; ask whether it is their account.
- AC-041 (crm, svc-reports@larkmoor.example) has display name Reports service, which matches nobody on the staff list.
- AC-043 (crm, t.rosenthal@larkmoor.example) has display name Tabitha Rosenthal, which matches Tabitha Rosenthal (E120, tabitha.rosenthal@larkmoor.example). Different email, so not matched; ask whether it is their account.
- AC-053 (cloud_console, deploy-bot@larkmoor.example) has display name Deploy bot, which matches nobody on the staff list.
- Approval for j.merrow@brightquill.example on code_host ran out on 2026-10-31.
- Clementine Vasquez (E118) has end date 2026-12-12 after the review date, so still treated as working here.
- Anders Mbeki (E119) has status active but end date 2026-11-14; treated as left.
check.py · the check, written before the run
"""Recomputes every access decision from the staff list and the written rules, then compares."""
import csv, re, sys
from datetime import date
from pathlib import Path

DECISIONS = ["keep", "remove_no_owner", "remove_leaver", "remove_not_needed", "lower_admin", "check_unused"]

NUM = re.compile(r"(?<![\w.-])\d(?:[\d,]*\d)?(?:\.\d+)?(?![\w-])")
DAY = re.compile(r"\d{4}-\d{2}-\d{2}")

def rows(p):
    with p.open(newline="") as fh:
        return list(csv.DictReader(fh))

def norm(s):
    return (s or "").strip().lower()

def expected(root):
    inp = root / "input"
    policy = (inp / "review_policy.md").read_text()
    review = date.fromisoformat(re.search(r"Review date:\s*(\d{4}-\d{2}-\d{2})", policy).group(1))
    max_days = int(re.search(r"more than (\d+) days", policy).group(1))
    staff = {norm(r["email"]): r for r in rows(inp / "staff.csv")}
    matrix = {r["system"]: r for r in rows(inp / "access_matrix.csv")}
    approved = {(norm(r["account"]), r["system"]): r for r in rows(inp / "approved_other_accounts.csv")}
    want = {}
    for r in rows(inp / "access_export.csv"):
        acct, system = norm(r["account"]), r["system"]
        person = staff.get(acct)
        emp = person["employee_id"] if person else ""
        ok = approved.get((acct, system))
        if ok and date.fromisoformat(ok["approved_until"]) >= review:
            d = "keep"
        elif not person:
            d = "remove_no_owner"
        elif person["end_date"].strip() and date.fromisoformat(person["end_date"].strip()) <= review:
            d = "remove_leaver"
        else:
            allowed = [x.strip() for x in matrix[system]["departments_allowed"].split(";")]
            is_it = person["department"] == "IT"
            last = r["last_sign_in"].strip()
            if not is_it and person["department"] not in allowed:
                d = "remove_not_needed"
            elif r["level"].strip() == "admin" and not is_it and matrix[system]["system_owner"] != emp:
                d = "lower_admin"
            elif not last or (review - date.fromisoformat(last)).days > max_days:
                d = "check_unused"
            else:
                d = "keep"
        want[r["access_id"]] = {"decision": d, "employee_id": emp, "system": system, "account": r["account"].strip()}
    leavers = {}
    for k, w in want.items():
        if w["decision"] == "remove_leaver":
            name = next(p["name"] for p in staff.values() if p["employee_id"] == w["employee_id"])
            leavers[name] = leavers.get(name, 0) + 1
    return want, leavers

def facts(root):
    """What may truthfully be said about each account: its dates, days unused, people, departments and system."""
    inp = root / "input"
    policy = (inp / "review_policy.md").read_text()
    review = re.search(r"Review date:\s*(\d{4}-\d{2}-\d{2})", policy).group(1)
    max_days = int(re.search(r"more than (\d+) days", policy).group(1))
    staff = rows(inp / "staff.csv")
    by_mail = {norm(p["email"]): p for p in staff}; by_id = {p["employee_id"]: p for p in staff}
    matrix = {r["system"]: r for r in rows(inp / "access_matrix.csv")}
    approved = rows(inp / "approved_other_accounts.csv")
    out = {}
    for r in rows(inp / "access_export.csv"):
        person = by_mail.get(norm(r["account"])); m = matrix[r["system"]]; owner = by_id.get(m["system_owner"])
        okd = [a for a in approved if norm(a["account"]) == norm(r["account"])]
        last = r["last_sign_in"].strip()
        out[r["access_id"]] = {
            "dates": {review, last, r["granted_on"].strip(), person["end_date"].strip() if person else "", person["start_date"].strip() if person and "start_date" in person else ""} | {a["approved_until"] for a in okd},
            "days": {max_days} | ({(date.fromisoformat(review) - date.fromisoformat(last)).days} if last else set()),
            "names": {p["name"] for p in (person, owner) if p},
            "ids": {p["employee_id"] for p in (person, owner) if p} | {a["responsible_employee"] for a in okd},
            "depts": {"IT"} | {x.strip() for x in m["departments_allowed"].split(";")} | ({person["department"]} if person else set()),
            "system": r["system"], "account": norm(r["account"]), "end": person["end_date"].strip() if person else "", "dept": person["department"] if person else "", "last": last}
    world = {"names": {p["name"] for p in staff}, "depts": {p["department"] for p in staff}, "systems": set(matrix), "review": review, "max_days": max_days,
             "ends": {p["name"]: p["end_date"].strip() for p in staff}, "approved": {a["approved_until"] for a in approved}}
    return out, world

def honest(text, f, world):
    """True when a sentence about one account says nothing that belongs to another account."""
    if any(d not in f["dates"] for d in DAY.findall(text)): return False
    bare = DAY.sub(" ", text)
    if any(int(x) not in f["days"] for x in re.findall(r"(?<![\w.-])(\d+) days?\b", bare)): return False
    if any(len(m.group(0)) >= 2 and float(m.group(0).replace(",", "")) not in f["days"] for m in NUM.finditer(bare)): return False
    if any(nm in text and nm not in f["names"] for nm in world["names"]): return False
    if any(e not in f["ids"] for e in re.findall(r"\bE\d{3}\b", text)): return False
    if any(re.search(r"(?<![\w-])" + re.escape(s) + r"(?![\w-])", text) and s != f["system"] for s in world["systems"]): return False
    if any(re.search(r"\b" + re.escape(d) + r"\b(?= department| team|,|\.|;| and| or|$)", text) and d not in f["depts"] for d in world["depts"]): return False
    return True

def main():
    root = Path(sys.argv[1]); ok = True
    def say(passed, text):
        nonlocal ok
        ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
    want, leavers = expected(root)
    path = root / "output/access_review.csv"
    if not path.exists():
        say(False, "output/access_review.csv was not written"); sys.exit(1)
    got_rows = rows(path)
    got = {(r.get("access_id") or "").strip(): r for r in got_rows}
    n = len(want)
    once = len(got_rows) == len(got) and set(got) == set(want)
    say(once, f"{len(set(got) & set(want))} of {n} accounts in the export appear once in access_review.csv")
    same = sum(1 for k, w in want.items() if (got.get(k, {}).get("system") or "").strip() == w["system"] and norm(got.get(k, {}).get("account")) == norm(w["account"]))
    say(same == n, f"{same} of {n} rows carry the same system and account as the access export")
    right = sum(1 for k, w in want.items() if norm(got.get(k, {}).get("decision")) == w["decision"])
    say(right == n, f"{right} of {n} decisions equal the decision recomputed from the staff list and the written rules")
    matched = [k for k, w in want.items() if w["employee_id"]]
    emp = sum(1 for k in matched if (got.get(k, {}).get("employee_id") or "").strip() == want[k]["employee_id"])
    blank = sum(1 for k, w in want.items() if not w["employee_id"] and not (got.get(k, {}).get("employee_id") or "").strip())
    say(emp == len(matched) and blank == n - len(matched),
        f"{emp} of {len(matched)} accounts that belong to a person carry that person's employee id and {blank} of {n - len(matched)} others are left blank")
    fact, world = facts(root)
    def reason_ok(k):
        text, f, d = (got.get(k, {}).get("reason") or "").strip(), fact[k], want[k]["decision"]
        if len(text.split()) < 3 or not honest(text, f, world): return False
        if d == "remove_leaver": return f["end"] in text
        if d == "remove_not_needed": return f["dept"] in text
        if d == "check_unused" and f["last"]: return f["last"] in text or any(int(x) in f["days"] - {world["max_days"]} for x in re.findall(r"\d+", DAY.sub(" ", text)))
        return True
    r_ok = sum(1 for k in want if reason_ok(k))
    say(r_ok == n, f"{r_ok} of {n} reasons give the deciding fact and state no date, day count, person, department or system that belongs to another account")
    summary = (root / "output/summary.md").read_text() if (root / "output/summary.md").exists() else ""
    counts_ok = 0
    for d in DECISIONS:
        m = re.search(re.escape(d) + r"[`*\s]*:[`*\s]*(\d+)", summary)
        if m and int(m.group(1)) == sum(1 for w in want.values() if w["decision"] == d):
            counts_ok += 1
    say(counts_ok == len(DECISIONS), f"{counts_ok} of {len(DECISIONS)} decision counts in summary.md equal the recomputed counts")
    remove = [k for k, w in want.items() if w["decision"].startswith("remove")]
    lines = summary.splitlines()
    def remove_line(k):
        f = fact[k]
        return any(re.search(re.escape(k) + r"(?!\d)", ln) and f["system"] in ln and f["account"] in ln.lower() and honest(ln.replace(k, " "), f, world) for ln in lines)
    named = sum(1 for k in remove if remove_line(k))
    say(named == len(remove), f"{named} of {len(remove)} accounts to remove are on a line of summary.md with their own system, account and facts")
    def leaver_line(name, count):
        return any(name in ln and world["ends"][name] in ln and re.search(r"(?<![\w.-])" + str(count) + r"(?![\w.-])", DAY.sub(" ", ln.replace(name, " "))) for ln in lines)
    people = sum(1 for name, count in leavers.items() if leaver_line(name, count))
    say(people == len(leavers), f"{people} of {len(leavers)} people who left and still hold an account are named in summary.md with their end date and number of accounts")
    seen = bad = 0
    counts = {float(sum(1 for w in want.values() if w["decision"] == d)) for d in DECISIONS} | {float(n), float(world["max_days"]), float(len(remove)), float(len(leavers))} | {float(c) for c in leavers.values()}
    for ln in lines:
        ids = [i for i in re.findall(r"AC-\d{3}(?!\d)", ln) if i in fact]
        names = [nm for nm in world["names"] if nm in ln]
        days = {world["review"]} | world["approved"] if not (ids or names) else set()
        nums = set(counts)
        for i in ids: days |= fact[i]["dates"]; nums |= {float(x) for x in fact[i]["days"]}
        for nm in names: days.add(world["ends"][nm])
        for d in DAY.findall(ln):
            seen += 1; bad += d not in days
        for m in NUM.finditer(DAY.sub(" ", ln)):
            if len(m.group(0)) >= 2:
                seen += 1; bad += float(m.group(0).replace(",", "")) not in nums
    say(seen > 0 and bad == 0, f"{seen - bad} of {seen} dates and numbers in summary.md match the staff list, the export or the recomputed counts")
    sys.exit(0 if ok else 1)

if __name__ == "__main__":
    main()

access_export.csv: sample data written by Atris. Fingerprint a3419f57298b.

access_matrix.csv: sample data written by Atris. Fingerprint bf4518835a65.

approved_other_accounts.csv: sample data written by Atris. Fingerprint a2c42ef0f190.

review_policy.md: sample data written by Atris. Fingerprint 1a663846255f.

staff.csv: sample data written by Atris. Fingerprint d06060ba1b29.

access_review.csv: written by the agent. Fingerprint 73c75ea86f02.

summary.md: written by the agent. Fingerprint d7161cc81da1.


More it and security work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms