Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Endpoints that authenticate but don't authorize
card 3 of 6
Checklist for any id from the request
builds on: Trust boundaries and untrusted input, What the agent cannot see
For each new endpoint, query or job that takes an id:
1. Where is the record loaded? Does the query filter by the caller's own `owner_id`/`org_id`, taken from the session and not from the request? Or is there an explicit check after loading?
2. If the check lives elsewhere, confirm the new route actually passes through it.
3. Nested ids: does the child belong to the parent?
4. Writes, deletes and lists too.
5. Ask for a test where another user gets 404.
Terms on this card
- endpoint
- One URL plus HTTP method that a server handles, such as GET /invoices/:id.
- 404
- HTTP status Not Found. Using it for someone else's record also hides that the record exists.
- caller
- Any place in code that invokes a function or uses a name, sometimes called a call site.
Lesson goal: Spot new endpoints or queries that check who the caller is but not whether they may access this record (insecure direct object references). Explain why agents copying a nearby handler often miss ownership checks that are enforced elsewhere in the codebase. ·
the whole lesson