
How I Organize an AI Project Around a Client Task
October 14, 2026
Agent Observability: Traces Metrics and Finding the First Wrong Step
October 14, 2026AI agent safety becomes critical when a system can turn uncertain interpretation into an external action. The central question is not “how intelligent is the model?” It is “what can this system read, change, send, spend, disclose, or delete when it is wrong?”
Safety starts with permissions and recovery, not with a promise that the model will behave perfectly.
Build a threat model around consequences
List the assets the agent can reach: private files, customer data, email, publishing systems, financial tools, code, infrastructure, or public accounts. Then list credible failure paths: misunderstood instructions, stale context, malicious content, over-broad tools, exposed secrets, incorrect target selection, repeated actions, and missing confirmation.
Rank the consequences. Reading a public page is not equivalent to sending a public message. Drafting a change is not equivalent to applying it. The control should match the consequence.
Separate read tools from write tools
Use distinct tools and permissions for reading, drafting, and committing. A research agent may need broad access to public sources but no authority to publish. A deployment assistant may prepare a change set while a human or separately controlled process applies it.
Do not give write access merely to make a demonstration smoother. Friction at a consequential boundary is often a safety feature.
Apply least privilege by default
Grant only the minimum data, functions, targets, and duration required for the current task. Prefer scoped credentials, restricted directories, test environments, and allow-listed destinations.
Permissions should expire or be revocable. A one-time migration does not justify standing access after the migration is complete.
Identity, permission and checks are separate
Authentication verifies a claimed identity; authorization determines what that identity may access or do. Google Cloud’s authentication overview distinguishes proving identity from checking access to a requested resource. An authenticated assistant is not thereby authorized to change every resource it can read.
A guardrail is a check or constraint around an AI interaction. NVIDIA’s guardrails overview describes checks at input, retrieval, dialogue, execution and output stages. Such checks need evaluation and can fail; they do not replace authorization or turn a model instruction into enforced permissions.
Imagine a fictional assistant permitted only to read a document that asks it to change access. That is an illustrative prompt-injection attempt, not a new grant of authority. In this proposed workflow, the assistant stays within its read task; any access change requires separate authorization outside the document. No real request, permission change or security test is being performed.
Treat external content as untrusted
Documents, webpages, emails, tickets, and retrieved text can contain instructions that conflict with the user’s intent. The agent should treat that material as data, not as authority.
Keep system rules, user authorization, and retrieved content separate. Do not let a document expand its own permissions, reveal secrets, disable safeguards, or redefine the target.
Confirm consequential actions at action time
Approval is strongest when the user sees the exact action, target, important parameters, and expected consequence immediately before execution. An early statement such as “help manage the site” is not approval for every later publication or deletion.
Require confirmation for public messages, irreversible changes, purchases, permission changes, sensitive disclosures, and other high-impact actions. When a series of actions is approved, define its boundaries and stop conditions.
Keep secrets outside the reasoning surface
Use approved secret stores or active authorized sessions. Do not place passwords, tokens, recovery codes, cookies, or private keys into prompts, logs, source files, or generated artifacts.
Redact logs so they remain useful without becoming a second secret store. Log the credential identifier or permission class, not the secret value.
Make actions auditable
For every material action, record who authorized it, what changed, the target, time, result, and relevant version. The log should distinguish a proposed action from an executed one.
Auditability supports incident response and learning. It does not justify collecting unrelated private data.
Use isolation and staging
Run untrusted or experimental work in a bounded environment. Test with synthetic or minimized data where practical. For publishing or infrastructure, use staging before production and prevent an experimental tool from silently crossing the boundary.
Isolation should also limit blast radius: one site, one project, one directory, one account, or one transaction class rather than a global permission.
Design rollback as part of the action
Before granting write access, identify what rollback means. It may be restoring a previous version, reverting a change set, moving a page back to draft, disabling a tool, revoking a credential, or switching to a manual process.
Some actions cannot be fully reversed. A sent email, exposed secret, public disclosure, or external purchase may require containment rather than rollback. Label those actions accordingly and demand stronger approval.
Prepare incident response
Define how the agent or operator stops work, preserves evidence, revokes access, identifies affected targets, notifies the responsible person, and verifies recovery. Do not let the same agent that caused a high-impact incident decide alone that the incident is resolved.
A practical permission matrix for AI agent safety
For each tool, document:
- allowed operations;
- prohibited operations;
- permitted targets;
- data classification;
- confirmation requirement;
- logging requirement;
- rollback or containment method;
- permission owner;
- expiry or review condition.
Begin with read-only access. Add drafting. Add bounded writes only after the evaluation, approval, logging, and recovery controls are credible.
AI agent safety is not a single prompt or filter. It is the combined design of authority, data boundaries, tool separation, confirmation, observability and recovery.
Primary sources
OWASP Gen AI Security Project: Excessive Agency
Related reading: AI Systems, Technology Foundations, and From AI Demo to Reliable Workflow.



