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.
Security checks switched off to make it work card 5 of 6

CORS: the second fix is worse

builds on: Agents optimise the signal they can see, Trust boundaries and untrusted input
You asked the agent to fix "blocked by CORS policy" for the new dashboard at `https://app.example.com`. First it sets `Access-Control-Allow-Origin: *`. The browser still refuses, because the dashboard's requests carry cookies and browsers reject `*` with credentials. The next fix echoes back whatever `Origin` arrives and adds `Access-Control-Allow-Credentials: true`. It works. It also means any page a logged-in user visits can read their data. **Better:** allow exactly `https://app.example.com`.
Terms on this card
CORS
Cross-Origin Resource Sharing: response headers that tell a browser which other websites' scripts may read the response.
Origin
The scheme, host and port of the page making a browser request, e.g. https://app.example.com. Browsers send it in the Origin header.
credentials
In CORS, the cookies or other login data a browser attaches to a request. Reading such responses cross-origin needs Access-Control-Allow-Credentials: true, and browsers then refuse `*` as the allowed origin.
the agent
The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
Learn this step by step on Bytewise
Lesson goal: Recognise protections turned off to get past an error: `verify=False`, Go's `InsecureSkipVerify`, Node's `rejectUnauthorized: false`, `Access-Control-Allow-Origin: *`, disabled CSRF protection and `chmod 777`. Explain the attack each one opens up. · the whole lesson