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 1 of 6

Login required, but whose invoice?

builds on: Trust boundaries and untrusted input, What the agent cannot see
You asked the agent to add a PDF download next to the existing invoice page. It copied the view handler, kept `requireLogin`, wrote a test and reports green. A week later a customer finds that editing the number in `/exports/invoices/1042/pdf` downloads another company's invoice. Every request was logged in. None was checked for whether that caller may see *that* invoice. This bug is an insecure direct object reference (IDOR).
Terms on this card
insecure direct object reference
A bug where a caller can reach any record just by supplying its id, because nothing checks they may access it.
IDOR
Short for insecure direct object reference.
requireLogin
In the example, a middleware that only checks that the caller is logged in (authentication), not which records they may access.
the agent
The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
green
A test or check that passes.
Learn this step by step on Bytewise
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