Adopt

AI Agent Permission Management: Guardrails and Sandboxes

・ Employee Store Operations

Summary

Managing AI agent permissions means deciding how far an AI is allowed to act. AI can make mistakes and can be manipulated from outside. This article explains how to narrow permissions, how to think about guardrails and sandboxes, how to decide which actions need human approval, and example settings in n8n and Dify.

The content of this article was checked on October 2, 2026, against official documentation from OWASP, n8n and Dify, and materials from the Japan AI Safety Institute (AISI) and Japan's Ministry of Economy, Trade and Industry (METI). Features and plan conditions may change. Check the sources at the end for the latest details.

When managing AI agent permissions, the question is what happens when the AI makes a wrong decision. The wider its permissions, the wider the damage from errors or hijacking. Types of damage are explained in AI agent security.

Grant only what is needed

OWASP's “Top 10 for LLM Applications 2026” lists ways to prevent Excessive Agency. The basic rule is to keep tools, functions and permissions all to the minimum needed.

  • Limit tools: if the agent does not need to fetch a URL's contents, do not give it that tool
  • Limit functions: if it only summarizes email, give it read access only, without sending or deleting
  • Avoid open-ended tools: instead of a tool that runs shell commands, build a tool that only writes to a file
  • Limit permissions: if it only recommends products, give it read access to the product table only, with no writing or deleting

OWASP also recommends that the program, not the AI, decides whether to allow an action. Writing “do not delete anything” in the AI's instructions will not stop it when the instruction is broken. Not granting delete permission in the first place is the reliable way to stop it.

AISI's “Guide to Evaluation Perspectives on AI Safety (version 1.20)” also includes example evaluation items that check whether an AI agent can access only the information and tools it needs.

Accounts and authentication for AI agents

Authentication for an AI agent decides whose permissions it runs with. OWASP recommends that actions taken on a user's behalf run within that user's permissions, with the minimum privileges. For example, for a tool that reads a user's code, ask the user to grant only the minimum scope through OAuth.

  • Create a dedicated account or API key for the AI agent, separate from people's accounts
  • Keep API keys and tokens on the program side, not with the AI
  • Do not put passwords or tokens in the AI's instructions (system prompt)
  • Choose permissions in connected apps to match the features you use

A dedicated AI account makes it easier to tell from the logs who took an action. If a problem occurs, you can disable just that account or key. OWASP's “Agentic AI - Threats and Mitigations” points out that if an AI agent's persistent identity is stolen, attackers may gain long-term API access.

Guardrails: check inputs and outputs

Guardrails are mechanisms that check what goes into the AI and what comes out. Anthropic's guide notes that having one model do the main task while another screens for inappropriate content tends to work better than having the same model do both.

3 places guardrails check

Input

  • Treat text loaded from outside separately from instructions
  • Strip invisible characters

Output

  • Check the format with code
  • Check the content before passing it to other systems

Before execution

  • Match values passed to tools against permissions
  • Check that counts and amounts stay under limits

OWASP recommends checking the output format with code rather than another AI. Even so, output can be in the right format and still have bad content. Do not rely on guardrails alone; combine them with narrowed permissions.

Sandboxes: a separate place to test

A sandbox is a testing environment cut off from production. Anthropic's guide notes that autonomous agents tend to cost more and can compound errors, and recommends extensive testing in sandboxed environments along with appropriate guardrails.

Moving from sandbox to production
  1. 1Set up a test environmentAccounts separate from production, plus test data
  2. 2Run the AI agentTry both the intended work and deliberately bad input
  3. 3Review the logsWhich tools it called, with what values
  4. 4Narrow permissionsRemove permissions it did not use
  5. 5Move to productionStart with approvals and limits still in place

In n8n, you can group workflows and credentials into projects. If you separate a test project from a production project and put only test credentials in the test project, nothing touches production data while you test. In Dify, you can also test in a separate app or workspace.

Sandboxes are also used to run code written by AI. OWASP's “Agentic AI - Threats and Mitigations” recommends restricting execution permissions for AI-generated code and running it in a sandbox.

Deciding which actions need human approval

Requiring human approval for every action adds to the reviewer's workload. OWASP describes a tiered approach: actions that are reversible or low-impact pass automatically, while irreversible or high-impact actions go to a person for review. As an example, it cites processing a refund in store credit automatically because it can be reversed, while sending a transfer outside goes to human approval.

Deciding whether approval is needed

Can the action be undone, and does it affect anything outside

Read-onlyProceed automaticallyKeep readable scope to the minimum
Internal writes that can be undoneProceed automatically and log itReview the log later
Sending outside, payments, deletionRun only after a person approvesInclude the details of the action in the approval request

The AI Guidelines for Business (version 1.2), issued by Japan's government, ask organizations to consider bringing in human judgment at appropriate points rather than letting AI decide alone. They also call for measures so that human judgment is not swayed by excessive trust in machines (automation bias). Make approval requests state specifically what the AI is about to do.

Example permission settings in n8n and Dify

Permissions in n8n

Permissions in n8n work at two levels: instance-wide roles and per-project roles. Instance roles are Owner, Admin and Member. Projects group workflows and credentials and are assigned Admin, Editor or Viewer roles. Viewer is read-only and cannot even run workflows manually.

Available roles depend on your plan. Project roles are available on all n8n Cloud plans and on self-hosted Registered Community, Business and Enterprise. Editor is available on n8n Cloud Pro and self-hosted Enterprise, and Viewer on Enterprise.

You can add human approval to an AI agent's tools. If approved, the tool runs; if rejected, it does not. Approval requests can be sent to Slack, Microsoft Teams, Gmail and more. If you self-host, you can run a security audit with the n8n audit command. The audit report is divided into five areas: credentials, database, filesystem, nodes and instance.

Permissions in Dify

A Dify workspace has four roles. Owner manages the whole workspace, and there is one per workspace. Admin can manage members and model providers. Editor can create, edit and delete apps and knowledge. Normal can only use published apps. The member limit is 1 on Sandbox, 3 on Professional and 50 on Team.

Web apps built with Dify are public by default, and anyone with the URL can open them. If they are for internal use only, check who can access them. Workflows have a Human Input node that pauses to wait for a person's input and can request confirmation by email or other channels. Agents let you set an iteration limit (Maximum Iterations).

How an organization sets rules for AI use is covered in AI governance, and preparing for mistakes and runaway behavior in AI agent risks.

When adopting through Employee Store

On Employee Store, you can adopt AI agents built by developers with a one-time purchase or a monthly plan. Before adopting, check which account the AI agent runs under, which permissions it needs and which actions require human approval. After purchase, you can ask the seller through messages in the deal room. AI agents on offer can be found in AI employees.

FAQ

What are guardrails for AI agents?
Mechanisms that check what goes into the AI and what comes out. Methods include treating text loaded from outside separately from instructions, checking the output format with code, and matching values against permissions before a tool runs.
What should I test in a sandbox?
Test whether the agent does the intended work correctly, and also how it behaves with deliberately bad input. Check the logs for which tools it called with what values, and remove permissions it did not use before moving to production.
Can I create view-only permissions for workflows in n8n?
The project Viewer role is read-only and cannot even run workflows manually. Viewer is available on n8n Cloud Enterprise and self-hosted Enterprise.

About the author

Employee Store OperationsThe operations team behind Employee Store, a marketplace for AI agents. We check tool features and pricing against official sources and list them at the end of each article. If you spot an error, please let us know via the contact form.

Sources

Ask AI

Ask AI if it fits your work.

Use your usual AI to explore what Employee Store offers and what to check before buying.

Opens an external AI service. Confirm pricing and deliverables on the listing page.