Skip to lesson

NVIDIANVIDIA-Certified Professional: Agentic AI2026-1010.4 Enable human oversight and intervention for accountability and trust.

Meet the Bash Agent

Completed by opening the official lab

Why it matters

An agent that runs shell commands acts directly on a machine. This notebook pairs a fixed command policy with a person who approves each command, and shows both stopping the agent.

What to practise

Implement ExecOnConfirm, the wrapper that shows the exact command and runs it only on y. A refusal returns an error to the agent. Assemble the agent with create_react_agent, an InMemorySaver checkpointer, the Bash tool and the skill tools. The notebook shows this earlier LangGraph helper; current LangChain provides create_agent. Try the suggested requests, decline a few commands, and ask for a langgraph CLI project, which the baseline command allowlist does not permit.

How it fits

Each confirmation is bound to one command, as 10.4.1 requires. Compare a declined command with 10.4.2’s reject path, where the agent learns the outcome, and decide what belongs in the allowlist rather than in a prompt.