Maddy Zhang, a senior software engineer previously at Google, presents a nine-minute framework for reviewing AI-generated code. The video is sponsored by 1Password.

Protect secrets and rotate exposed keys

  • Keep API keys and database passwords out of agent conversations and committed files.
  • Zhang demonstrates 1Password’s Environments MCP server, a connector that lets the agent manage variable names while withholding values through that channel.
  • Rotate a credential that has already leaked; moving it into a secret manager cannot undo the exposure.

Follow data across the system

  • Trace user input into pages, logs, database queries and permission checks rather than reading the diff as isolated lines.
  • Review authentication, authorization, encryption and concurrency with the wider application’s behavior in mind.
  • Put security and secret scanners in commit hooks or continuous integration so checks run consistently.

Review new dependencies as trust decisions

  • “Slopsquatting” exploits package names invented by models: attackers register the recurring names and supply malicious code.
  • Check that a proposed package exists, has credible maintainers and has a history before approving installation.
  • Inspect lockfile changes, which record exact dependencies, and require approval for new packages.

Limit what the agent can reach

  • Untrusted project metadata can trigger commands during repository inspection, before the main coding task begins.
  • Zhang also describes agents exposing internal screenshots while trying to provide evidence of a completed interface fix.
  • Set task-specific permissions, short-lived access and an audit trail; keep production credentials away from the development environment.

Own the merge decision

  • Be able to explain both what the change does and why it is safe before approving it.
  • A fresh AI session can review a diff from an attacker’s perspective alongside human review and automated checks.
  • Caveat: the vulnerability rates and incident counts are reports cited by Zhang. They depend on their task sets and observation dates.

“If you can’t explain what a change does and why it’s safe, it isn’t ready to merge.” — Maddy Zhang, 8:16