Security
14. What is slopsquatting, and how do you stop it reaching your lockfile?
Slopsquatting is registering a package name that models tend to hallucinate, then waiting for an agent or developer to install it.
The research behind it, "We Have a Package for You!" at USENIX Security 2025, generated 576,000 code samples with 16 models and found 205,474 unique hallucinated package names.
Defenses work at three levels. The agent should not be able to install packages without approval. Every new dependency in a diff gets checked: does it exist, how old is it, who publishes it, and does the repository match.
CI should install from the lockfile only and run a dependency scanner.
# before accepting a new dependency the agent added
npm view left-pad-utils time.created maintainers repository.url
pip index versions fastjson-schema # does it exist on PyPI at all?
# CI installs exactly what was reviewed
npm ci # fails if package.json and the lockfile disagree
A strong candidate also mentions a project rule ("do not add dependencies without asking") plus a CI check that flags any lockfile change for explicit review.
15. How do you keep a coding agent away from secrets?
Keep real secrets off the machine where the agent runs, deny its file tools access to secret files, and isolate its shell with a sandbox. Each layer covers a gap in the others.
In Claude Code, a Read deny rule blocks the agent's file tools from a path:
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(./secrets/**)"
]
}
}
The same docs warn that Bash rules match the command text the agent writes and are not a security boundary around a program, so a shell command in a different form can still reach a file.
That is why OS-level sandboxing (restricting filesystem and network access) and scoped, short-lived development credentials matter more than any single rule. Production keys should never be readable from a laptop session.
Ask the candidate what they do if a secret does land in the agent's context: treat it as exposed and rotate it.
16. How can prompt injection reach a coding agent, and what limits the damage?
Through any text the agent reads: an issue, a pull request comment, a README in a dependency, a web page or a tool result.
In May 2025, Invariant Labs showed a malicious public GitHub issue that led an agent using the GitHub MCP server to pull data from the owner's private repositories and publish it in a pull request on the public one.
Invariant's point was that this was not a bug in the server code. The agent used permissions it legitimately had.
The fixes are therefore about scope: a token limited to the one repository the task needs, one repository per session, and no "always allow" on tools that write to public places.
A senior candidate frames the risk as a combination: untrusted input, access to private data and a way to send data out. Remove any one of the three from a session and the injection has nothing to exploit.
17. What permissions would you give an agent on your laptop, and in CI?
On a laptop, the narrowest mode that keeps you productive: allowlist the commands you trust, keep deny rules for secrets and destructive commands, and turn on the sandbox.
In CI, pre-approve exactly the tools the job needs and deny everything else.
# non-interactive run in CI: only these tools, everything else denied
claude -p "Fix the failing lint errors in src/billing/" \
--allowedTools "Read,Edit,Bash(pnpm lint *)" \
--permission-mode dontAsk
Claude Code evaluates rules deny first, then ask, then allow, so a broad deny such as Bash(aws *) wins over a narrower allow.
The docs say bypassPermissions should only be used in isolated environments such as containers or VMs, and that administrators can disable it through managed settings.
Red flag: a candidate who runs with all permission checks off on the same laptop that holds production cloud credentials, because "the prompts slow me down."
18. How do you check AI-generated code for security bugs?
Assume the generated code is insecure at boundaries until shown otherwise, and back human review with automated scanning. Veracode's July 2025 study tested more than 100 models on 80 tasks and found security vulnerabilities in 45% of cases.
Java failed more than 70% of the time, and log injection defenses failed in 88% of cases.
How it is counted. Veracode's 45% is the share of its 80 curated tasks where a model chose an insecure way to write the code. It measures model behavior on a fixed test set, not the share of all AI-written code in production that is vulnerable.
In practice: run static analysis and dependency scanning on every pull request, keep a review checklist for input handling, output encoding, authorization and logging, and use a dedicated security reviewer (a person, or a subagent with a narrow brief) on anything that touches authentication or user input.
Good candidates know the specific weak spots.
Models write working code more readily than secure code, so the review focuses where "works" and "safe" differ: string-built SQL, unescaped HTML, user data written to logs, and missing ownership checks on records.