See the system
Let models propose actions while trusted software controls permissions, state transitions, and execution.
Choose between a workflow and an agent
A deterministic workflow follows known steps. An agent chooses among available actions using a model. Flexibility can help with variable tasks, but also adds uncertainty, cost, and failure paths. If the steps are known, start with a workflow.
Define allowed tools, termination conditions, maximum steps, time limits, and spending limits. Multi-agent arrangements should solve an observed coordination problem rather than exist simply to make the architecture look advanced.
Make tools narrow and explicit
A tool contract defines allowed inputs, outputs, permissions, and side effects. Prefer a focused function such as propose_ticket_status over unrestricted arbitrary code or database access. Validate every argument and resource reference.
Tool descriptions help a model choose an action but do not enforce authorization. The backend must check the caller and current state. Structured model output is still an untrusted proposal.
Bind approval to an exact action
Approval should reference a specific action payload, actor, resource, and validity period. If the proposed amount, target, or status changes, previous approval should not authorize the new action. The approver must be permitted to approve it.
At execution, recheck permissions and relevant resource state. A user interface confirmation alone is insufficient if a direct API call can bypass it. Treat approval records as trusted backend state, not text emitted by the model.
Prevent duplicate or stale writes
A request may time out after a write commits. An idempotency key identifies one logical operation so a retry can return the original result instead of repeating the side effect. Reusing the same key for a different payload must fail.
Handle concurrency and stale state with a transaction or appropriate version check. Approval is not permission to overwrite a resource that changed meaningfully since review. Record the resulting audit event atomically where possible.
Treat external content as data
Retrieved documents, tool outputs, and third-party pages can contain malicious instructions. They do not outrank the application’s policy. Limit available tools, constrain outputs, and enforce access in code.
Observe the sequence of proposed and executed actions, including denied actions. An operator should be able to tell why execution stopped: exhausted budget, absent evidence, revoked authorization, invalid arguments, or upstream failure.
Worked scenario
The assistant proposes changing ticket T-101 to resolved. A supervisor approves that exact proposal. Before execution, the ticket belongs to a different team. The backend must reject the stale action or require a fresh approved proposal; the old approval is not a general-purpose token to modify any ticket.
Practical assignment
- Run the reference lab’s proposal and approval tests.
- Inspect action payload binding and expiry.
- Test a direct execute call without approval.
- Repeat a valid operation and check idempotency.
- Reuse a key with a changed payload and verify rejection.
- Explain which identity/concurrency features a production integration must add.
What to submit
Submit the artifacts named above, a short explanation of your decisions, and evidence of the checks you performed. Distinguish measured results from estimates and designs from executed integrations.
| Review dimension | Submission evidence |
|---|---|
| Correctness | Show the expected behavior and a meaningful counterexample. |
| Reproducibility | State setup, inputs, versions, and what was actually executed. |
| Delivery judgment | Explain the client impact, alternative, and unresolved assumption. |
| Operational boundary | Identify permissions, failure behavior, and any resource cleanup. |
Knowledge check
Answer guide
- Trusted backend logic. The model may propose actions; the trusted application enforces the boundary.
- Require a new valid approval. Approval must bind to the exact reviewed action.
- To identify one logical operation across retries. Retries can occur after a side effect has already committed.
References & next step
Platform examples are environment-dependent. Start with the official documentation in the reference library and verify the exact cloud, region, privileges, and versions you use.
Open the official reference library
Editorial edition: 5 October 2026. The local reference lab is executed locally; this course does not claim a live Databricks deployment.