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

The tell: login guard, id-only lookup

builds on: Trust boundaries and untrusted input, What the agent cannot see
Tell: the route has `requireLogin`, and the query filters on `req.params.id` alone. Nothing ties the invoice to `req.user`. BETTER: `where: { id: req.params.id, orgId: req.user.orgId }`. Another org's id then finds nothing and gets 404 rather than 403, which also hides that the invoice exists. Later cost: anyone with an account can walk the ids and download every invoice, with no error and nothing odd in the logs.
// TypeScript
--- a/src/routes/exports.ts
+++ b/src/routes/exports.ts
@@ -12,0 +13,8 @@
+r.get("/invoices/:id/pdf", requireLogin,
+  async (req, res) => {
+    const inv = await db.invoice.findFirst({
+      where: { id: req.params.id },
+    });
+    if (!inv) return res.sendStatus(404);
+    res.type("pdf").send(await toPdf(inv));
+  });
Terms on this card
requireLogin
In the example, a middleware that only checks that the caller is logged in (authentication), not which records they may access.
404
HTTP status Not Found. Using it for someone else's record also hides that the record exists.
403
HTTP status Forbidden: the caller is known but not allowed. It reveals that the record exists.
tell
An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
guard
In Rust, the value returned by `lock()`. The mutex stays locked while the guard lives and unlocks when it is dropped.
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