Home
About Us
Read the Blog
Illustration contrasting a generic "looks good" AI response with a specific graded critique, labeled with the Google Cloud logo and the headline "AI Prompts for Developers," representing adversarial versus agreeable AI prompting.
Tips & TutorialsGemini and Google AIUpdated

Google Engineers' Best AI Prompts for Developers

Google Cloud asked ten of its own engineers what AI prompt they refuse to work without. The answers reveal a single pattern: turn AI into a skeptical second opinion, not an agreeable assistant.

Techmash

Techmash

Every prompt on Google's list exists to stop AI from defaulting to agreement. Ask a model to "review this code" or "help me plan this feature," and it tends to hand back polite encouragement: clean naming, a docstring suggestion, a green light. None of that catches what actually breaks in production. Each of the ten Google engineers built a workaround: assign the model a specific, demanding persona, force a real judgment such as a grade or a list of trade-offs, and refuse to accept its first answer as final.

What's the single best AI code review prompt to steal first?

The best AI code review prompt to steal is a harsh grading rubric: assign the model a strict reviewer persona and force it to grade your code A through F on production readiness, with no A unless it's genuinely robust. It comes from Shir Meir Lador, Head of AI, Developer Relations at Google Cloud, who named the exact failure mode this fixes.

"If you ask an LLM to review your code, it almost always defaults to being polite," she wrote. "It tells you your naming is clean, suggests a few docstrings, and hands you a green checkmark. But polite reviews don't prevent production outages."

"It's like having an uncompromising senior dev sitting over your shoulder, pointing out exactly where you got lazy, and then handing you the exact code to fix it." Shir Meir Lador, Head of AI, Developer Relations, Google Cloud

Her prompt checks efficiency, resilience, and architecture, and closes by demanding an exact fix rather than just commentary. A rubric with a real failing condition forces the model to actually look for what would break instead of defaulting to encouragement.

How do you use AI to write a spec before any code exists?

You make the model argue with the idea first, not write code for it. Maja Bilić, Senior Outbound Product Manager at Google Cloud, assigns the model a cynical principal architect and PM persona, explicitly forbids it from writing code, and has it list the technical, UX, and architectural risks in a proposed feature before asking targeted questions on each one. Only once that back-and-forth is done does it turn the answers into a spec.

The detail worth copying is her guardrail: an instruction not to over-engineer or oversimplify either direction, since AI tends to drift toward one or the other in product design docs. It works for the same reason giving an AI coding tool instructions it actually follows matters for a persistent project file: specificity up front changes what the model produces later.

Why should you make AI defend its own plan?

Because a confident, well-formatted plan can feel like a settled decision when it's really just one option among several. James O'Reilly, the Google Cloud post's author and a Staff Developer Relations Engineer, uses one of the shortest prompts on the list: after getting an implementation plan, ask the model to lay out its own trade-offs across performance, cost, security, and maintainability.

"I force AI to stress-test its own logic," he wrote. "By asking it about the trade-offs being made, I find the AI will rethink its strategy, stay hyper-focused on our specific implementation and avoid giving vague, hand-wavy responses. I also find this approach prevents AI from acting like the final authority and keeps me in control of the decision making." It's a two-sentence prompt, and it works on almost any AI-generated plan, not just code.

How do you automate AI code review in CI/CD?

Wire the same adversarial review prompt into your pull request pipeline so it runs on every PR, not just the ones someone remembers to check. Remigiusz Samborski, Lead Developer Relations Engineer at Google Cloud, runs an automated Gemini CLI review through GitHub Actions on most of his projects. As AI generates more code, he argues, review becomes the bottleneck. Automating the adversarial pass lets human reviewers focus on architecture instead of catching typos.

The same logic applies past code review specifically. TechMash has covered turning the manual checks you already do into something that runs automatically for Claude Code, and the underlying idea is identical: a check that depends on someone remembering to run it eventually stops running.

Why does this matter right now?

Because AI is generating a growing share of production code, and a meaningful chunk of it ships with real problems attached. A 2022 study of GitHub Copilot, cited in later security research, found that roughly 40% of 1,689 generated programs contained a genuine vulnerability, with C code running closer to 50%. That finding predates today's models, but newer research keeps landing in the same range rather than overturning it.

Trust hasn't caught up to adoption, either. Google's 2025 DORA report found that more than 80% of developers say AI increased their productivity, while roughly 30% still report little to no trust in the code it produces, a gap researchers are calling the industry's trust paradox. Speed brings its own cost, too. Carnegie Mellon researchers comparing GitHub projects using the AI coding tool Cursor against a matched control group found that early speed gains often erode from downstream quality and maintainability problems.

None of that proves ten prompts fix software engineering. It shows the specific gap these Google engineers are working around, an AI that agrees too easily, is measurable, not hypothetical.

Pick one prompt before adopting the rest. Lador's grading rubric is the fastest way to feel the actual difference between a model being polite and one working against your blind spots, and it takes one paste into your next pull request to find out.

Techmash

Techmash

FAQ

Frequently Asked Questions

Prompt engineering is the practice of deliberately shaping what you ask an AI model, including its role, constraints, and the format of its answer, so the response is useful rather than generic. The Google Cloud prompts in this article are a practical example: each one assigns a persona and a forced output (a grade, a checklist, a list of trade-offs) instead of a vague, open-ended request.

Because a plain review request gives the model no reason to be critical. Shir Meir Lador, Head of AI, Developer Relations at Google Cloud, points out that LLMs default to being polite, noting your naming is clean and suggesting a docstring, rather than flagging what would actually break in production. Assigning a strict persona and forcing a real grade changes that default.

Yes. Remigiusz Samborski, Lead Developer Relations Engineer at Google Cloud, runs an adversarial review prompt through Gemini CLI inside GitHub Actions on most of his projects, so every pull request gets reviewed automatically instead of depending on someone remembering to ask.

The pattern, not the specific tool, is what matters. Every prompt in this article is a persona-plus-forced-judgment structure that works with any capable AI assistant; Google's engineers happen to use Gemini and Gemini CLI internally, but the same structure applies to other coding assistants.

Category

Tips & Tutorials

Practical guides, tips and tutorials for getting more out of AI

[ Related ]

More in Tips & Tutorials