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.
String-built SQL, shell commands and HTML card 6 of 6

Pass values as data, never as text

builds on: Trust boundaries and untrusted input
If untrusted input is pasted into text that a database, shell or browser will parse, that is a tell. Use parameterised queries, argument arrays, `textContent` or auto-escaping templates instead. Tests with normal input stay green either way, so judge the code by how it builds the string, not by whether it ran.
Terms on this card
parameterised queries
SQL written with placeholders, with values passed as a separate argument instead of being pasted into the query text.
argument arrays
Passing a program and its arguments as a list. The OS runs the program directly, and no shell interprets ;, |, $() or quotes.
`textContent`
DOM property that sets an element's text. The string is shown as literal characters and never parsed as HTML.
auto-escaping templates
Templating that converts characters like < and & into harmless text by default, such as Go html/template, React JSX, and Jinja when autoescape is on (Flask enables it for .html templates).
tell
An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
Learn this step by step on Bytewise
Lesson goal: Spot injection risks in agent code: f-string or concatenated SQL, `shell=True` or `exec` with interpolated input, and `innerHTML` or unescaped templates. Replace each with parameterised queries, argument arrays or safe encoding. · the whole lesson