Q101Coding workflows, agents, and tool use
Design a reliable AI-assisted feature workflow.
Start with requirements and acceptance criteria, inspect the repository, propose a plan, implement a small slice, add tests, run checks, review the diff, and summarize evidence.
Answer
Design a reliable AI-assisted feature workflow. is best understood in the context of a real development workflow. Start with requirements and acceptance criteria, inspect the repository, propose a plan, implement a small slice, add tests, run checks, review the diff, and summarize evidence.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Request -> inspect -> plan -> patch -> tests -> review -> merge
Syntax
Request -> inspect -> plan -> patch -> tests -> review -> merge
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use approvals for destructive operations and production changes.
Q102Coding workflows, agents, and tool use
What is the ReAct-style agent loop?
A common agent loop alternates between reasoning about the task, taking a tool action, observing its result, and deciding the next step.
Answer
What is the ReAct-style agent loop? is best understood in the context of a real development workflow. A common agent loop alternates between reasoning about the task, taking a tool action, observing its result, and deciding the next step.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Observe -> decide -> tool call -> result -> next step
Syntax
Observe -> decide -> tool call -> result -> next step
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Tool results can be incomplete or untrusted and must be interpreted carefully.
Q103Coding workflows, agents, and tool use
What is tool calling in a coding agent?
Tool calling lets a model request a structured action such as reading a file, searching code, or running a test through an execution environment.
Answer
What is tool calling in a coding agent? is best understood in the context of a real development workflow. Tool calling lets a model request a structured action such as reading a file, searching code, or running a test through an execution environment.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Model request: run `npm test` -> tool executes -> output returned
Syntax
Model request: run `npm test` -> tool executes -> output returned
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- The environment should validate permissions and arguments.
Q104Coding workflows, agents, and tool use
What is least privilege for coding agents?
Give an agent only the files, commands, credentials, and network access required for its task.
Answer
What is least privilege for coding agents? is best understood in the context of a real development workflow. Give an agent only the files, commands, credentials, and network access required for its task.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Read-only inspection first; grant write access only to the task workspace
Syntax
Read-only inspection first; grant write access only to the task workspace
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Restrict production credentials and destructive tools by default.
Q105Coding workflows, agents, and tool use
How do you design an approval gate?
Require approval before high-impact actions such as deleting data, changing permissions, installing untrusted packages, or deploying to production.
Answer
The key is to connect the recommendation to the goal in the question: how do you design an approval gate? The short definition is: Require approval before high-impact actions such as deleting data, changing permissions, installing untrusted packages, or deploying to production.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: if action in high_risk_actions: require_human_approval()
Syntax
if action in high_risk_actions: require_human_approval()
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Risk classification must account for indirect effects and command scripts.
Q106Coding workflows, agents, and tool use
How can an agent verify a change rather than merely claim success?
Run reproducible commands, capture exit status and relevant output, inspect the resulting diff, and report exactly which checks passed or failed.
Answer
The key is to connect the recommendation to the goal in the question: how can an agent verify a change rather than merely claim success? The short definition is: Run reproducible commands, capture exit status and relevant output, inspect the resulting diff, and report exactly which checks passed or failed.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: npm run lint && npm test && git diff --check
Syntax
npm run lint && npm test && git diff --check
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- A command that was not run must be reported as not run.
Q107Coding workflows, agents, and tool use
What is a plan-execute-review pattern?
The agent first proposes steps, executes the approved plan, then checks outcomes against acceptance criteria and reports deviations.
Answer
What is a plan-execute-review pattern? is best understood in the context of a real development workflow. The agent first proposes steps, executes the approved plan, then checks outcomes against acceptance criteria and reports deviations.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: Plan -> approval -> execute -> verify -> summarize
Syntax
Plan -> approval -> execute -> verify -> summarize
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Replan when new evidence invalidates an assumption.
Q108Coding workflows, agents, and tool use
How should a coding agent recover from tool failure?
Inspect the failure message, check environment assumptions, make one evidence-based adjustment, and retry a bounded action; otherwise report the blocker.
Answer
The key is to connect the recommendation to the goal in the question: how should a coding agent recover from tool failure? The short definition is: Inspect the failure message, check environment assumptions, make one evidence-based adjustment, and retry a bounded action; otherwise report the blocker.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Command fails -> read stderr -> diagnose missing dependency -> retry
Syntax
Command fails -> read stderr -> diagnose missing dependency -> retry
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid infinite retries and destructive trial-and-error.
Q109Coding workflows, agents, and tool use
What is idempotency in agent workflows?
An idempotent operation can be repeated without unintended additional effects, which is important when tool calls may be retried.
Answer
What is idempotency in agent workflows? is best understood in the context of a real development workflow. An idempotent operation can be repeated without unintended additional effects, which is important when tool calls may be retried.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Ensure a migration step checks whether the resource already exists
Syntax
Ensure a migration step checks whether the resource already exists
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Not every shell command or external API call is idempotent.
Q110Coding workflows, agents, and tool use
How can you make generated changes easier to review?
Limit scope, keep patches coherent, separate refactoring from behavior changes, add tests, and include a concise rationale in the summary.
Answer
The key is to connect the recommendation to the goal in the question: how can you make generated changes easier to review? The short definition is: Limit scope, keep patches coherent, separate refactoring from behavior changes, add tests, and include a concise rationale in the summary.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: One feature branch -> small diff -> targeted tests
Syntax
One feature branch -> small diff -> targeted tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid mixing formatting-only changes with logic changes.
Q111Coding workflows, agents, and tool use
What is a coding agent's tool boundary?
It is the defined set of actions and resources available to the agent, including filesystem, shell, network, and external services.
Answer
What is a coding agent's tool boundary? is best understood in the context of a real development workflow. It is the defined set of actions and resources available to the agent, including filesystem, shell, network, and external services.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Allowed: read repo, run tests; restricted: production deploy, secret store
Syntax
Allowed: read repo, run tests; restricted: production deploy, secret store
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use operating-system and platform controls, not prompt instructions alone.
Q112Coding workflows, agents, and tool use
How do you safely run tests generated by an agent?
Inspect scripts and dependencies first, use isolated test data and least-privilege credentials, then run in a controlled environment.
Answer
The key is to connect the recommendation to the goal in the question: how do you safely run tests generated by an agent? The short definition is: Inspect scripts and dependencies first, use isolated test data and least-privilege credentials, then run in a controlled environment.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: cat package.json; npm ci; npm test
Syntax
cat package.json
npm ci
npm test
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Tests may execute arbitrary project code and access configured resources.
Q113Coding workflows, agents, and tool use
What is a benchmark for coding-agent quality?
A benchmark uses representative tasks with defined expected outcomes and evaluates correctness, tests, regressions, and effort to review.
Answer
What is a benchmark for coding-agent quality? is best understood in the context of a real development workflow. A benchmark uses representative tasks with defined expected outcomes and evaluates correctness, tests, regressions, and effort to review.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Task set -> fixed environment -> run -> evaluate patch and tests
Syntax
Task set -> fixed environment -> run -> evaluate patch and tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid judging quality solely by model confidence or completion rate.
Q114Coding workflows, agents, and tool use
How should parallel agents coordinate?
Assign independent tasks and file ownership, agree on interfaces, avoid overlapping edits, and integrate through explicit review and tests.
Answer
The key is to connect the recommendation to the goal in the question: how should parallel agents coordinate? The short definition is: Assign independent tasks and file ownership, agree on interfaces, avoid overlapping edits, and integrate through explicit review and tests.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Agent A: API; Agent B: docs; integrator: contract tests
Syntax
Agent A: API; Agent B: docs; integrator: contract tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Parallelism can create conflicting assumptions and integration overhead.
Q115Coding workflows, agents, and tool use
What is context pollution?
Context pollution is irrelevant, stale, duplicated, or misleading information that makes an assistant less focused on the actual task.
Answer
What is context pollution? is best understood in the context of a real development workflow. Context pollution is irrelevant, stale, duplicated, or misleading information that makes an assistant less focused on the actual task.
A practical workflow is to state the goal, provide only the relevant files and constraints, define observable acceptance criteria, and ask for assumptions to be called out. Review the result against those criteria instead of relying on confident wording.
For example, the related workflow or pattern can be illustrated as: Replace long unrelated logs with the exact error and relevant source
Syntax
Replace long unrelated logs with the exact error and relevant source
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Keep context fresh and task-specific.
Q116Coding workflows, agents, and tool use
How can you use retrieval for repository questions?
Search symbols, documentation, and tests to retrieve relevant snippets, then ask the model to answer from those sources with paths or evidence.
Answer
The key is to connect the recommendation to the goal in the question: how can you use retrieval for repository questions? The short definition is: Search symbols, documentation, and tests to retrieve relevant snippets, then ask the model to answer from those sources with paths or evidence.
Results depend on the model, the context it receives, and the task complexity. Check factual and code-level claims against authoritative project sources, and split large tasks into smaller steps with explicit expected outputs.
For example, the related workflow or pattern can be illustrated as: rg "CreateOrder" src tests
Syntax
rg "CreateOrder" src tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Retrieval quality depends on search scope, indexing, and naming.
Q117Coding workflows, agents, and tool use
What is an agent memory file?
It is a persistent store of project notes or preferences used across tasks. It should contain stable, useful facts and be reviewed for stale or sensitive content.
Answer
What is an agent memory file? is best understood in the context of a real development workflow. It is a persistent store of project notes or preferences used across tasks. It should contain stable, useful facts and be reviewed for stale or sensitive content.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Store test command and architecture notes, not credentials
Syntax
Store test command and architecture notes, not credentials
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Do not treat remembered notes as more authoritative than current source code.
Q118Coding workflows, agents, and tool use
How do you prevent an agent from deleting user changes?
Check the working tree before edits, avoid broad resets, use dedicated branches or worktrees, and restore only known agent-created changes.
Answer
The key is to connect the recommendation to the goal in the question: how do you prevent an agent from deleting user changes? The short definition is: Check the working tree before edits, avoid broad resets, use dedicated branches or worktrees, and restore only known agent-created changes.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: git status --short; git diff
Syntax
git status --short
git diff
Example
Review the working-tree diff, run targeted checks, and commit only the intended changes.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Never run `git reset --hard` without understanding the working tree impact.
Q119Coding workflows, agents, and tool use
What is a worktree-based agent workflow?
Separate Git worktrees allow independent branches and working directories, reducing file conflicts between concurrent tasks.
Answer
What is a worktree-based agent workflow? is best understood in the context of a real development workflow. Separate Git worktrees allow independent branches and working directories, reducing file conflicts between concurrent tasks.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: git worktree add ../feature-worktree -b feature/ai-task
Syntax
git worktree add ../feature-worktree -b feature/ai-task
Example
Review the working-tree diff, run targeted checks, and commit only the intended changes.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Share only the integration contract and verify commits before merging.
Q120Coding workflows, agents, and tool use
How do you handle external side effects during agent execution?
Use mocks or test environments by default; require explicit authorization for real emails, payments, deployments, or destructive data changes.
Answer
The key is to connect the recommendation to the goal in the question: how do you handle external side effects during agent execution? The short definition is: Use mocks or test environments by default; require explicit authorization for real emails, payments, deployments, or destructive data changes.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Set PAYMENT_MODE=test in local integration tests
Syntax
Set PAYMENT_MODE=test in local integration tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- A test command may still trigger real side effects if misconfigured.
Q121Coding workflows, agents, and tool use
What is a verification pyramid for AI changes?
Use fast static checks and unit tests first, then integration and end-to-end tests, plus manual review for high-risk behavior.
Answer
What is a verification pyramid for AI changes? is best understood in the context of a real development workflow. Use fast static checks and unit tests first, then integration and end-to-end tests, plus manual review for high-risk behavior.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: format -> lint/typecheck -> unit -> integration -> e2e
Syntax
format -> lint/typecheck -> unit -> integration -> e2e
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Select checks based on the changed behavior and risk.
Q122Coding workflows, agents, and tool use
How should an agent reason about failing CI?
Identify the failing job and exact step, reproduce it locally when feasible, distinguish flaky/environment failures from regressions, and report evidence.
Answer
The key is to connect the recommendation to the goal in the question: how should an agent reason about failing CI? The short definition is: Identify the failing job and exact step, reproduce it locally when feasible, distinguish flaky/environment failures from regressions, and report evidence.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Read CI log -> reproduce command -> patch -> rerun
Syntax
Read CI log -> reproduce command -> patch -> rerun
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Do not weaken CI checks just to obtain a green build.
Q123Coding workflows, agents, and tool use
What is a safe rollback strategy for an AI-generated change?
Use version control and small commits, deploy gradually where appropriate, monitor health, and ensure data changes have an explicit recovery plan.
Answer
What is a safe rollback strategy for an AI-generated change? is best understood in the context of a real development workflow. Use version control and small commits, deploy gradually where appropriate, monitor health, and ensure data changes have an explicit recovery plan.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Feature flag -> staged rollout -> monitor -> disable/rollback
Syntax
Feature flag -> staged rollout -> monitor -> disable/rollback
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Code rollback alone may not reverse database or external side effects.
Q124Coding workflows, agents, and tool use
How do you enforce coding standards beyond prompts?
Use formatters, linters, type checks, tests, pre-commit hooks, and CI policies for requirements that must be consistently enforced.
Answer
The key is to connect the recommendation to the goal in the question: how do you enforce coding standards beyond prompts? The short definition is: Use formatters, linters, type checks, tests, pre-commit hooks, and CI policies for requirements that must be consistently enforced.
A practical workflow is to state the goal, provide only the relevant files and constraints, define observable acceptance criteria, and ask for assumptions to be called out. Review the result against those criteria instead of relying on confident wording.
For example, the related workflow or pattern can be illustrated as: npm run lint && npm run typecheck
Syntax
npm run lint && npm run typecheck
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Prompt compliance is probabilistic; automated gates are more reliable.
Q125Coding workflows, agents, and tool use
How can an agent produce an audit trail?
Record the task, files changed, commands run, test outcomes, approvals, and relevant commit or build identifiers without recording secrets.
Answer
The key is to connect the recommendation to the goal in the question: how can an agent produce an audit trail? The short definition is: Record the task, files changed, commands run, test outcomes, approvals, and relevant commit or build identifiers without recording secrets.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Task ID -> diff -> command logs -> review decision
Syntax
Task ID -> diff -> command logs -> review decision
Example
Review the working-tree diff, run targeted checks, and commit only the intended changes.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Sanitize logs and follow organizational retention policies.
Q126AI-assisted software engineering and security
What is threat modeling for an AI coding feature?
Identify assets, trust boundaries, actors, entry points, abuse cases, and mitigations before building an AI-enabled feature or granting an agent tools.
Answer
What is threat modeling for an AI coding feature? is best understood in the context of a real development workflow. Identify assets, trust boundaries, actors, entry points, abuse cases, and mitigations before building an AI-enabled feature or granting an agent tools.
Results depend on the model, the context it receives, and the task complexity. Check factual and code-level claims against authoritative project sources, and split large tasks into smaller steps with explicit expected outputs.
For example, the related workflow or pattern can be illustrated as: Assets -> threats -> mitigations -> tests
Syntax
Assets -> threats -> mitigations -> tests
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Include prompt injection, data leakage, and excessive tool permissions.
Q127AI-assisted software engineering and security
How does prompt injection affect coding agents?
Untrusted instructions in issues, webpages, source comments, or retrieved files can attempt to manipulate agent behavior or exfiltrate information.
Answer
The key is to connect the recommendation to the goal in the question: how does prompt injection affect coding agents? The short definition is: Untrusted instructions in issues, webpages, source comments, or retrieved files can attempt to manipulate agent behavior or exfiltrate information.
A practical workflow is to state the goal, provide only the relevant files and constraints, define observable acceptance criteria, and ask for assumptions to be called out. Review the result against those criteria instead of relying on confident wording.
For example, the related workflow or pattern can be illustrated as: Untrusted text -> model context -> unsafe tool request
Syntax
Untrusted text -> model context -> unsafe tool request
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use tool permissions, data isolation, and explicit trust boundaries.
Q128AI-assisted software engineering and security
Why is output validation important for generated code?
Model output can be syntactically valid but semantically unsafe. Validate through parsing, type checking, tests, static analysis, and human review.
Answer
The key is to connect the recommendation to the goal in the question: why is output validation important for generated code? The short definition is: Model output can be syntactically valid but semantically unsafe. Validate through parsing, type checking, tests, static analysis, and human review.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Generate -> parse -> lint -> test -> review
Syntax
Generate -> parse -> lint -> test -> review
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Never execute generated code blindly in a privileged environment.
Q129AI-assisted software engineering and security
How should secrets be protected in AI workflows?
Avoid placing secrets in prompts or logs, use scoped short-lived credentials, restrict file access, redact outputs, and rotate credentials if exposed.
Answer
The key is to connect the recommendation to the goal in the question: how should secrets be protected in AI workflows? The short definition is: Avoid placing secrets in prompts or logs, use scoped short-lived credentials, restrict file access, redact outputs, and rotate credentials if exposed.
Treat generated output as untrusted until reviewed. Do not expose credentials or sensitive data in prompts, validate inputs at system boundaries, use least-privilege access, and verify security-sensitive changes with tests and established review procedures.
For example, the related workflow or pattern can be illustrated as: Secret manager -> short-lived token -> limited tool session
Syntax
Secret manager -> short-lived token -> limited tool session
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Review data-handling settings and organizational policies.
Q130AI-assisted software engineering and security
What is data exfiltration risk in an AI agent?
An agent with access to sensitive files and network tools might transmit data to an unauthorized destination due to malicious content or mistakes.
Answer
What is data exfiltration risk in an AI agent? is best understood in the context of a real development workflow. An agent with access to sensitive files and network tools might transmit data to an unauthorized destination due to malicious content or mistakes.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Sensitive file + network permission = potential exfiltration path
Syntax
Sensitive file + network permission = potential exfiltration path
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Restrict network egress and sensitive-file access where feasible.
Q131AI-assisted software engineering and security
How should AI-generated SQL avoid injection?
Use parameterized queries or safe ORM parameter binding; never interpolate untrusted input into executable SQL text.
Answer
The key is to connect the recommendation to the goal in the question: how should AI-generated SQL avoid injection? The short definition is: Use parameterized queries or safe ORM parameter binding; never interpolate untrusted input into executable SQL text.
Treat generated output as untrusted until reviewed. Do not expose credentials or sensitive data in prompts, validate inputs at system boundaries, use least-privilege access, and verify security-sensitive changes with tests and established review procedures.
For example, the related workflow or pattern can be illustrated as: const result = await db.query(; "SELECT * FROM users WHERE id = $1",; [userId]; );
Syntax
const result = await db.query(
"SELECT * FROM users WHERE id = $1",
[userId]
);
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Validate authorization separately from input parameterization.
Q132AI-assisted software engineering and security
How can an AI assistant introduce a supply-chain vulnerability?
It may recommend a malicious or typosquatted package, an unpinned dependency, or an unsafe install script. Verify package identity, provenance, version, and maintenance.
Answer
The key is to connect the recommendation to the goal in the question: how can an AI assistant introduce a supply-chain vulnerability? The short definition is: It may recommend a malicious or typosquatted package, an unpinned dependency, or an unsafe install script. Verify package identity, provenance, version, and maintenance.
Treat generated output as untrusted until reviewed. Do not expose credentials or sensitive data in prompts, validate inputs at system boundaries, use least-privilege access, and verify security-sensitive changes with tests and established review procedures.
For example, the related workflow or pattern can be illustrated as: npm view package-name name version repository; npm audit
Syntax
npm view package-name name version repository
npm audit
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Package registries and audit tools are useful signals, not guarantees.
Q133AI-assisted software engineering and security
What is secure-by-design prompting?
It states required controls such as authentication, authorization, validation, safe error handling, logging hygiene, and tests as acceptance criteria.
Answer
What is secure-by-design prompting? is best understood in the context of a real development workflow. It states required controls such as authentication, authorization, validation, safe error handling, logging hygiene, and tests as acceptance criteria.
A practical workflow is to state the goal, provide only the relevant files and constraints, define observable acceptance criteria, and ask for assumptions to be called out. Review the result against those criteria instead of relying on confident wording.
For example, the related workflow or pattern can be illustrated as: "Enforce object-level authorization; reject invalid input; do not log tokens."
Syntax
"Enforce object-level authorization; reject invalid input; do not log tokens."
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Prompts should complement architecture and automated security controls.
Q134AI-assisted software engineering and security
How should AI-generated authentication code be reviewed?
Verify password handling, token validation, issuer/audience checks, expiration, key rotation, authorization, rate limiting, and failure behavior against established libraries and s
Answer
The key is to connect the recommendation to the goal in the question: how should AI-generated authentication code be reviewed? The short definition is: Verify password handling, token validation, issuer/audience checks, expiration, key rotation, authorization, rate limiting, and failure behavior against established libraries and s.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: Validate signature + issuer + audience + expiry before trusting JWT claims
Syntax
Validate signature + issuer + audience + expiry before trusting JWT claims
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Prefer maintained security libraries over custom cryptography.
Q135AI-assisted software engineering and security
How do you assess license and provenance concerns in generated code?
Follow organizational policy, inspect dependency licenses and source provenance, and use available repository or compliance scanning tools.
Answer
The key is to connect the recommendation to the goal in the question: how do you assess license and provenance concerns in generated code? The short definition is: Follow organizational policy, inspect dependency licenses and source provenance, and use available repository or compliance scanning tools.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Generate patch -> scan dependencies and license policy -> review
Syntax
Generate patch -> scan dependencies and license policy -> review
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Legal obligations depend on code source, licenses, and jurisdiction.
Q136AI-assisted software engineering and security
What is a false positive in AI code review?
A false positive is a reported problem that does not represent a real defect in the relevant context.
Answer
What is a false positive in AI code review? is best understood in the context of a real development workflow. A false positive is a reported problem that does not represent a real defect in the relevant context.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: Review claim -> inspect code path -> reproduce or disprove
Syntax
Review claim -> inspect code path -> reproduce or disprove
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Record why a finding was dismissed when the risk is material.
Q137AI-assisted software engineering and security
What is a false negative in AI code review?
A false negative is a real defect that the review fails to identify, so passing AI review cannot establish that a patch is defect-free.
Answer
What is a false negative in AI code review? is best understood in the context of a real development workflow. A false negative is a real defect that the review fails to identify, so passing AI review cannot establish that a patch is defect-free.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: Threat model + tests + human review supplement AI findings
Syntax
Threat model + tests + human review supplement AI findings
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use layered controls, particularly for security-sensitive changes.
Q138AI-assisted software engineering and security
How can AI-generated code create a privacy issue?
It may log personal data, expose fields in API responses, or send sensitive content to an external service unnecessarily.
Answer
The key is to connect the recommendation to the goal in the question: how can AI-generated code create a privacy issue? The short definition is: It may log personal data, expose fields in API responses, or send sensitive content to an external service unnecessarily.
Treat generated output as untrusted until reviewed. Do not expose credentials or sensitive data in prompts, validate inputs at system boundaries, use least-privilege access, and verify security-sensitive changes with tests and established review procedures.
For example, the related workflow or pattern can be illustrated as: Allowlist response fields; redact logs
Syntax
Allowlist response fields; redact logs
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Minimize collection and verify data retention and access controls.
Q139AI-assisted software engineering and security
What should an AI coding policy define?
Define permitted data, approved tools, review requirements, secret handling, licensing, security gates, and accountability for code merged into production.
Answer
What should an AI coding policy define? is best understood in the context of a real development workflow. Define permitted data, approved tools, review requirements, secret handling, licensing, security gates, and accountability for code merged into production.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Policy -> tool configuration -> CI gates -> periodic audit
Syntax
Policy -> tool configuration -> CI gates -> periodic audit
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Tailor controls to data classification and risk.
Q140AI-assisted software engineering and security
How do you measure defect escape rate for AI-assisted work?
Track defects discovered after merge or release relative to delivered changes, comparing similar tasks and controlling for severity and exposure.
Answer
The key is to connect the recommendation to the goal in the question: how do you measure defect escape rate for AI-assisted work? The short definition is: Track defects discovered after merge or release relative to delivered changes, comparing similar tasks and controlling for severity and exposure.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Escaped defects / delivered changes (define unit consistently)
Syntax
Escaped defects / delivered changes (define unit consistently)
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Interpret metrics carefully; small samples and task mix can mislead.
Q141AI-assisted software engineering and security
What is an AI coding evaluation set?
It is a curated set of realistic tasks with expected behavior and grading criteria used to compare models or workflow changes over time.
Answer
What is an AI coding evaluation set? is best understood in the context of a real development workflow. It is a curated set of realistic tasks with expected behavior and grading criteria used to compare models or workflow changes over time.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Fixed tasks + fixed repo snapshot + tests + human rubric
Syntax
Fixed tasks + fixed repo snapshot + tests + human rubric
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Prevent benchmark leakage and refresh tasks as codebases evolve.
Q142AI-assisted software engineering and security
How can you test an AI agent for prompt injection?
Create safe test fixtures containing malicious instructions in untrusted files and verify that the agent ignores them, protects secrets, and respects tool boundaries.
Answer
The key is to connect the recommendation to the goal in the question: how can you test an AI agent for prompt injection? The short definition is: Create safe test fixtures containing malicious instructions in untrusted files and verify that the agent ignores them, protects secrets, and respects tool boundaries.
A practical workflow is to state the goal, provide only the relevant files and constraints, define observable acceptance criteria, and ask for assumptions to be called out. Review the result against those criteria instead of relying on confident wording.
For example, the related workflow or pattern can be illustrated as: Fixture: README asks to print a dummy secret; expected: no secret disclosure
Syntax
Fixture: README asks to print a dummy secret; expected: no secret disclosure
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use dummy data and isolated environments for red-team tests.
Q143AI-assisted software engineering and security
How do you design human approval for high-risk agent actions?
Classify actions by impact, show the exact command or change, explain target and side effects, and require an authorized person to approve before execution.
Answer
The key is to connect the recommendation to the goal in the question: how do you design human approval for high-risk agent actions? The short definition is: Classify actions by impact, show the exact command or change, explain target and side effects, and require an authorized person to approve before execution.
A reliable agent workflow separates planning, tool execution, and verification. Give it the minimum permissions needed, inspect file changes and command output, and require tests or other evidence before treating the task as complete.
For example, the related workflow or pattern can be illustrated as: Proposed action -> risk summary -> human approval -> execute -> log
Syntax
Proposed action -> risk summary -> human approval -> execute -> log
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Approval must be bound to the action actually executed.
Q144AI-assisted software engineering and security
What is the difference between model confidence and correctness?
A fluent or confident response can still be wrong. Correctness requires evidence such as tests, source references, and validated behavior.
Answer
What is the difference between model confidence and correctness? is best understood in the context of a real development workflow. A fluent or confident response can still be wrong. Correctness requires evidence such as tests, source references, and validated behavior.
Results depend on the model, the context it receives, and the task complexity. Check factual and code-level claims against authoritative project sources, and split large tasks into smaller steps with explicit expected outputs.
For example, the related workflow or pattern can be illustrated as: Claim -> supporting source -> test result
Syntax
Claim -> supporting source -> test result
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Do not use confidence language as a substitute for verification.
Q145AI-assisted software engineering and security
How should AI be used in regulated or safety-critical code?
Apply the same or stronger controls as other code: traceability, independent verification, documented risk analysis, formal review, and domain-specific compliance processes.
Answer
The key is to connect the recommendation to the goal in the question: how should AI be used in regulated or safety-critical code? The short definition is: Apply the same or stronger controls as other code: traceability, independent verification, documented risk analysis, formal review, and domain-specific compliance processes.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Requirement -> implementation -> test evidence -> approval record
Syntax
Requirement -> implementation -> test evidence -> approval record
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Applicable obligations depend on the domain and jurisdiction.
Q146AI-assisted software engineering and security
What is an effective AI code review rubric?
Evaluate correctness, security, performance, maintainability, test adequacy, scope control, and consistency with requirements; require evidence for major findings.
Answer
What is an effective AI code review rubric? is best understood in the context of a real development workflow. Evaluate correctness, security, performance, maintainability, test adequacy, scope control, and consistency with requirements; require evidence for major findings.
Evaluate the proposed change for correctness, readability, compatibility, edge cases, and maintainability. Prefer a small diff with clear intent, preserve existing conventions, and use automated checks to support—not replace—human review.
For example, the related workflow or pattern can be illustrated as: Score each dimension with explicit evidence and severity
Syntax
Score each dimension with explicit evidence and severity
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid a single subjective score without actionable observations.
Q147AI-assisted software engineering and security
How do you handle generated code that passes tests but is poorly designed?
Assess complexity, duplication, coupling, error handling, and future change cost; request a focused refactor only where the improvement is justified.
Answer
The key is to connect the recommendation to the goal in the question: how do you handle generated code that passes tests but is poorly designed? The short definition is: Assess complexity, duplication, coupling, error handling, and future change cost; request a focused refactor only where the improvement is justified.
Start by reproducing the behavior and collecting a failing test, stack trace, or minimal example. Change one likely cause at a time, rerun the focused check, then run relevant regression tests so a local fix does not hide a wider problem.
For example, the related workflow or pattern can be illustrated as: Passing tests + maintainability review -> accept or refine
Syntax
Passing tests + maintainability review -> accept or refine
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid cosmetic refactors that expand risk without value.
Q148AI-assisted software engineering and security
What is the role of observability in AI-generated changes?
Logs, metrics, traces, and useful error signals help detect regressions and diagnose behavior after deployment.
Answer
What is the role of observability in AI-generated changes? is best understood in the context of a real development workflow. Logs, metrics, traces, and useful error signals help detect regressions and diagnose behavior after deployment.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Track error rate, latency, saturation, and key business outcomes
Syntax
Track error rate, latency, saturation, and key business outcomes
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Avoid logging secrets or excessive personal data.
Q149AI-assisted software engineering and security
How do you design a safe AI-powered code generation service?
Separate model generation from execution, validate inputs and outputs, isolate builds, restrict credentials and network, scan artifacts, and require review before deployment.
Answer
The key is to connect the recommendation to the goal in the question: how do you design a safe AI-powered code generation service? The short definition is: Separate model generation from execution, validate inputs and outputs, isolate builds, restrict credentials and network, scan artifacts, and require review before deployment.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Request -> policy check -> model -> isolated validation -> review -> release
Syntax
Request -> policy check -> model -> isolated validation -> review -> release
Example
State the goal, constraints, and acceptance criteria; provide relevant repository context and verify the output.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Treat both prompts and generated artifacts as untrusted.
Q150AI-assisted software engineering and security
Draw a secure AI-assisted development pipeline.
Developers submit a task; the assistant retrieves limited context, proposes a patch, and runs isolated checks. CI scans and tests the diff, a human reviews it, and only approved ar
Answer
Draw a secure AI-assisted development pipeline. is best understood in the context of a real development workflow. Developers submit a task; the assistant retrieves limited context, proposes a patch, and runs isolated checks. CI scans and tests the diff, a human reviews it, and only approved ar.
Apply it to a small, representative task first. Compare the proposed result with the project requirements, inspect edge cases, run the appropriate tests or checks, and keep the change only when it is correct and understandable.
For example, the related workflow or pattern can be illustrated as: Developer -> task + scoped context -> AI proposal; -> isolated build/tests -> SAST/dependency scan; -> human review -> CI gates -> approved release; (secrets isolated; logs redacted; actions audited)
Syntax
Developer -> task + scoped context -> AI proposal
-> isolated build/tests -> SAST/dependency scan
-> human review -> CI gates -> approved release
(secrets isolated; logs redacted; actions audited)
Example
Add a test for expected behavior and an edge case, then run the project's test command.
Code example
// Example workflow (adapt to your repository)
const task = {
goal: "Implement the smallest correct change",
constraints: ["preserve existing behavior", "avoid unrelated edits"],
acceptanceCriteria: ["tests pass", "diff reviewed"],
};
console.log(task.goal);
Diagram
Task + context -> plan -> edit -> tests/checks -> review diff -> merge
Key Points
- Use least privilege, reproducible builds, and auditable approval gates.