View a markdown version of this page

What the agent can and can't access - Amazon WorkSpaces

What the agent can and can't access

The agent on your WorkSpace runs as its own Windows account, separate from yours, with fewer rights than you have. Your administrator's policies decide which of your folders it can read or change and whether it can reach the internet. Windows applies those limits to the agent and to the programs that the agent starts.

Note

This feature is in public preview. Features and behavior are subject to change.

Because the agent has its own account, some tools behave differently when the agent runs them than when you run them yourself. This page lists what the agent can reach by default, what you might notice, and what to do about it.

What the agent can reach by default

Files. By default, the agent can read and change files in your workspace folder (%USERPROFILE%\workspace), where chat and terminal sessions start, and in its own folders. It can also read, but not change, a default set of your folders: Documents, Desktop, Downloads, common source-code folders such as source and repos, and developer tool caches. WorkSpaces blocks it from reading common credential locations, such as .ssh and .aws, even inside those folders. A copy of a secret in another folder that the agent can read is readable to the agent, so keep secrets out of those folders, or ask your administrator to add your secret folders to deniedPaths. Files that the agent creates are owned by the agent's account, not by you.

Your administrator can give the agent access to more folders, or block folders, with policies. readablePaths and writablePaths in the OS policy grant read or write access. Folders in workingDirectories in the Agent Harness policy are also writable. deniedPaths in the OS policy blocks the agent from a folder, and a denied folder wins over a grant. For more information, see Security policies in the agent-ready WorkSpaces Administration Guide.

Internet. By default, the agent and the programs that it starts can't reach the internet. Your administrator can turn on internet access for the agent. The setting applies only to the agent: you and your own apps keep your normal network access. Model requests and MCP connectors that your administrator sets up, such as a GitHub connector, keep working while the agent's internet access is off, because they go through the WorkSpaces gateway. Git, package managers, and other downloads still need the agent's internet access. For more information, see Internet and downloads. While its internet access is off, the agent also can't connect to other WorkSpaces. The agent can never reach the instance metadata service.

Desktop and clipboard. The agent runs on a desktop of its own. Windows that the agent opens aren't visible to you. WorkSpaces blocks the agent from capturing your screen, sending input to your windows, and using your clipboard.

Your programs and administrator rights. Because the agent runs as its own account, Windows blocks it from controlling your programs, reading their memory, or stopping processes that you own. Windows also blocks it from using your administrator rights, even if you're a local administrator on the WorkSpace. Programs that the agent starts end when its session ends.

Network identity. The agent has no domain identity, and Windows blocks it from using your domain sign-in. As a result, the agent doesn't have your access to network file shares or other domain services. Files on network shares, and profiles stored by roaming profiles or FSLogix, aren't available to the agent.

Files and folders

Documents and ~ mean the agent's own folders. If you ask the agent to list the files in Documents, it shows its own, mostly empty folder. In commands that the agent runs, ~ and %USERPROFILE% also point to the agent's profile.

What to do: Give the agent the full path to your folder, for example D:\Users\user\Documents.

The agent can create files in some folders that your policy doesn't name. Where Windows lets every user create files, such as the root of the D: drive, C:\ProgramData, and C:\Windows\Temp, the agent can create files without a grant. Removing a write grant doesn't stop this. Files that you own in those folders stay read-only to the agent.

What to do: To keep the agent out of a folder, ask your administrator to add it to deniedPaths. A denied folder also blocks reads.

Removing a grant doesn't remove all of the agent's access. After your administrator removes a folder from the agent's grants, files that the agent already has open stay open, and some folders that the agent created there can stay open to it. Removing a grant on a folder inside your workspace folder changes nothing, because the workspace folder stays writable.

What to do: Start a new agent session after your administrator removes a grant.

A grant for a folder that doesn't exist doesn't take effect. The policy accepts a path that doesn't exist, with no warning, and the console still shows the policy as in sync. The agent then has no access to that folder.

What to do: If the agent can't write to a folder that your administrator granted, ask your administrator to check that the path in the policy exists and is spelled the same way.

Some Python tools fail in folders that your policy names. In a folder named in workingDirectories or writablePaths, or in a subfolder of one, the agent can't create a folder with its own permissions. As a result:

  • pytest on Python 3.12 prints its progress line and then stops responding, with one CPU core busy. Python 3.14 and later show PytestCacheWarning instead.

  • os.mkdir(path, 0o700) fails with PermissionError: [WinError 5], and tempfile.mkdtemp fails with FileExistsError: [Errno 17].

  • uv and setuptools source builds fail with PermissionError [WinError 5]. On Python 3.12, the setuptools build stops responding instead.

  • The agent can't change permissions on its own files there, for example with icacls or Set-Acl.

Normal file and folder work in those folders isn't affected. Your workspace folder, and subfolders of it that no policy names, aren't affected either.

What to do:

  • Run these tools in your workspace folder, or in a subfolder of it that no policy names.

  • For pytest in a named folder, run python -m pytest -p no:cacheprovider, or -o cache_dir= with a folder in the agent's profile or Temp folder.

  • For uv, keep the uv cache and the build output in their default location. Don't point UV_CACHE_DIR or -o into the named folder.

  • Ask your administrator to name only folders outside your workspace folder in workingDirectories and writablePaths. Subfolders of the workspace folder are already writable.

You can't open or delete some folders that the agent creates. Python's private folders, which pytest's .pytest_cache, tempfile.mkdtemp, and os.mkdir(..., 0o700) create, are open only to the agent, SYSTEM, and Administrators. Without administrator rights you can't list, read, or delete them. git clean -fdx and git status warn about them, and git clean fails with Directory not empty. A private key that the agent creates with ssh-keygen -f is unreadable to you, but del /f and git clean can delete it.

What to do: To remove such a folder, run Remove-Item -Recurse -Force path from an elevated PowerShell, or ask your administrator.

The agent can't create symbolic links. mklink and mklink /D fail with You do not have sufficient privilege to perform this operation. In PowerShell 5.1, New-Item -ItemType SymbolicLink fails with Administrator privilege required for this operation. The symlink calls in Python, Node.js, Java, Rust, and Go fail with A required privilege is not held by the client. Junctions and hard links work, and most tools fall back on their own:

  • python -m venv --symlinks copies the files instead, and the virtual environment works.

  • With Git's default core.symlinks=false, Git writes a symbolic link as a small text file that holds the target path. A clone with core.symlinks=true of a repository that has a symbolic link fails at checkout.

  • npm link, npm install file:.., and pnpm link create junctions, and the links work.

What to do: Use a junction (mklink /J) or a hard link (mklink /H) where that's enough. Keep Git's default core.symlinks=false. Expect tests that create symbolic links to fail or be skipped.

Keep Windows Developer Mode off. With Developer Mode on, the agent can create symbolic links.

What to do: Don't turn on Developer Mode on a WorkSpace where the agent runs.

A copied Python virtual environment depends on its base Python. Because the agent's virtual environments are copies, each one starts the base Python installation. If the base Python folder is moved or removed, the virtual environment stops working.

What to do: Keep the base Python folder in place. If it moves, run python -m venv --upgrade env with the Python from the new location, or create the virtual environment again.

Denied folders

A folder in deniedPaths blocks the agent, and programs that it starts, from reading or writing files that are created in or copied into the folder. In the following cases, a denied folder doesn't block access.

A file with its own permissions can stay readable. A file or subfolder inside a denied folder that doesn't inherit the folder's permissions keeps its own permissions. If those allow all users, such as Users, Authenticated Users, or Everyone, the agent can read it.

What to do: Keep secrets in files that only you can read. Inside denied folders, keep permission inheritance turned on.

A file that you move into a denied folder keeps its old permissions. If you move a file into a denied folder from elsewhere on the same drive, for example with Move-Item or move, the file keeps its old permissions. If those let the agent read it, the agent can still read it, with PowerShell and with Claude Code's Read and Grep tools. A file that you copy into the folder inherits the deny when it's copied.

What to do: Copy sensitive files into a denied folder instead of moving them. For a file that you already moved, run icacls file /reset so it inherits the folder's deny. The reset also removes the permissions that you set on that file yourself.

A new denied folder is open for up to about 30 seconds. If a denied folder doesn't exist when the policy applies, it gets its deny within about 30 seconds after it's created. Until then, a denied folder that the agent creates is under its full control, and a denied folder inside one of the agent's folders can be open to it.

What to do: Ask your administrator to create denied folders before the policy applies.

git clean can delete a denied folder. If you run git clean -fdx in a repository that contains a denied folder, Git deletes the folder as it does other untracked folders. When the folder is created again, it's denied again within about 30 seconds.

What to do: No workaround. Keep denied folders outside repositories.

Claude Code reports a denied file in an unexpected way. When the agent reads a file that it's denied, Claude Code's Read tool can report that where it leads on disk could not be determined instead of reporting that access is denied. Glob and Grep on a denied folder fail with os error 5.

What to do: Treat these messages as access denied.

Tools and PATH

The agent doesn't see your PATH or tools that you install for yourself. At each launch, the agent gets the machine PATH, read fresh. Your own user PATH isn't included. Tools installed for one user, for example under AppData\Local\Programs in your profile, aren't available to the agent, even by full path. A tool installed for all users, by an installer that updates the machine PATH, is available in new agent sessions, but not in a session that's already open.

What to do: Install tools that you share with the agent for all users, and then start a new agent session. Or ask your administrator to install them. If a tool is in a tool-cache folder that the agent can read, the agent can call it by its full path. If you use rustup from your own profile, the agent can run cargo once RUSTUP_HOME points at your .rustup folder.

A PATH change that the agent makes lasts for one command. If the agent sets $env:Path in a command, the change is gone in the next command, which then reports The term 'tool' is not recognized. The agent can't save a PATH. setx and user environment variables fail with a registry access error.

What to do: See the next item to keep tools on the agent's PATH. For one command, the agent can call the tool by its full path, or put $env:Path = 'folder;' + $env:Path; in front of the command and repeat it in later commands.

Keep tools available with project settings. To keep the agent's tools on its PATH in a project, set env.PATH in .claude\settings.local.json in the project folder. You can ask the agent to write the file, or write it yourself.

  • Put the tool folders first, and then the full PATH that the session started with. env.PATH replaces the PATH.

  • Write the values out in full. Values are literal, so %PATH% and $env:Path don't work.

  • Add the home variables that your tools need, such as JAVA_HOME, CARGO_HOME, RUSTUP_HOME, DOTNET_ROOT, and GOPATH.

The agent uses the new PATH from its next command and in new sessions, including ! commands. The file applies to that project folder only. Because it holds a copy of the machine PATH, update it after a later install for all users. If you delete the file, the change takes effect in the next session. In auto mode, Claude Code can refuse the agent's write to this file. If it does, confirm the write in your prompt, or write the file yourself.

Call project-local tools by path. For tools in a project folder, such as node_modules\.bin or .venv\Scripts, call them by relative or full path, for example .\node_modules\.bin\eslint or .\.venv\Scripts\python.exe, or use npx. Or add the folder to env.PATH as in the previous item. Don't rely on a CLAUDE_ENV_FILE hook to set PATH for the PowerShell tool.

Tools that the agent installs go into its own folders. The agent can install Git, Node.js, Python, Rust, Java, .NET, and Go into its own folders, by unzipping a release or by running the tool's own install script. The official Python installer fails for the agent. A per-user Git installer might finish copying files and then not exit.

What to do: Use zip releases or each tool's own install script, then add the tool folders to env.PATH as described earlier. If an installer doesn't exit after its files are in place, stop it with Stop-Process.

The agent's caches take space on C:. The agent's package caches are in its own profile on C:. The npm cache can grow to about 150 to 160 MB, and the NuGet cache to about 100 MB.

What to do: Plan disk space on C:. For NuGet, you can move the package folder with NUGET_PACKAGES, set in the command, in env in .claude\settings.local.json, or in NuGet.Config.

Git

Your repositories in granted folders work. In a repository that you own, in a folder granted to the agent, the agent's Git works with no setup from you. In a folder that the agent can only read, Git reads work, and a commit fails with Permission denied on .git/index.lock. The agent's commits use the name and email from your Git configuration. A name that the agent sets itself is reset in its next session.

Your Git refuses repositories that the agent created. When you open a repository that the agent created, your Git reports detected dubious ownership. This is on purpose: a repository can carry hooks that would run as you.

What to do: Before you trust the repository, check its .git\hooks folder and the core.hooksPath setting in .git\config, if it has one. Then run git config --global --add safe.directory path. To trust several repositories under one folder, use the folder path followed by /*. After you trust a repository, its hooks run as you.

Local-path submodules are refused. git submodule add path and git submodule update --init fail with fatal: transport 'file' not allowed. This is Git's own default.

What to do: For a path that you trust, run git -c protocol.file.allow=always submodule add path or git -c protocol.file.allow=always submodule update --init.

The agent doesn't have access to your saved Git credentials. A push that needs credentials fails, for example with Unable to persist credentials and then could not read Username. When the agent's internet access is on, clones of public repositories over HTTPS work.

What to do: Push the changes yourself.

Native .exe Git hooks fail. A hook such as pre-commit.exe fails with cannot spawn .git/hooks/pre-commit.exe: No such file or directory. Script hooks, such as #!/bin/sh, work. A hook that starts with #!node also fails when you run Git yourself, because Git needs a shell to read that line.

What to do: Set core.hooksPath to the absolute path of the hooks folder, for example git config core.hooksPath D:/repos/app/.git/hooks. Or use script hooks. To skip hooks for one commit, use git commit --no-verify.

Claude Code's Bash tool needs Git for Windows installed for all users. The PowerShell tool is the default, and ! commands run in PowerShell. Claude Code offers the Bash tool only when Git for Windows is installed for all users, when Git's cmd folder is on the machine PATH, or when CLAUDE_CODE_GIT_BASH_PATH points at a full Git's bin\bash.exe in the machine environment or the agent's own user settings. Setting the variable or PATH in a project's .claude\settings.json or settings.local.json doesn't turn on the Bash tool. A Git that the agent installs can't turn it on, and MinGit has no bash.exe.

What to do: Ask for PowerShell commands. If you need the Bash tool, ask your administrator to install Git for Windows for all users, to add Git's cmd folder to the machine PATH, or to set CLAUDE_CODE_GIT_BASH_PATH in the machine environment. Then start a new agent session.

A running agent can stop your Git Bash from starting. The agent shares your Windows session. While an agent process holds a resource that Git Bash uses, your Git Bash might not start.

What to do: End the agent's session. Git Bash starts again within a second of the agent's process ending.

Hooks and MCP servers

Hooks and project MCP servers run on their own. Hooks and MCP servers from your settings or from a project's settings run automatically, as the agent's account and inside its limits. MCP servers from a project's .mcp.json start without an approval request, unless your administrator allows only managed MCP servers. They don't go through the WorkSpaces gateway.

What to do: Before you work in a project, review its .claude folder and its MCP configuration. For more information, see Approve agent actions.

Languages and build tools

Rust, Python, .NET, Java, Node.js, and Go builds work for the agent. The following items are what's left.

Rust and C/C++ builds need the Visual Studio Build Tools. Without them, cargo build, cargo test, and cargo install fail with linker link.exe not found. With them, Rust builds work, including build.rs scripts that compile C. cl.exe and link.exe aren't on PATH, but Rust and the cc crate find them on their own.

What to do: Ask your administrator to install Visual Studio Build Tools 2022 with the C++ build tools workload, for all users. The install takes about 3 to 7 minutes and about 9 GB on C:.

vcvars64.bat prints a vswhere.exe message. Each call prints 'vswhere.exe' is not recognized as an internal or external command,. The exit code is 0, and cl and link work.

What to do: Ignore the message.

Uninstalling the Build Tools with winget can stop responding. winget uninstall waited on a hidden prompt for 9 minutes and had to be stopped.

What to do: Ask your administrator to uninstall with the Visual Studio Installer's setup.exe uninstall --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" --quiet --norestart, and then restart the WorkSpace.

MSVC builds with debug information leave mspdbsrv running. An MSVC build with cl /Zi /FS, or a parallel build, starts mspdbsrv, which keeps running after the build. link.exe also leaves vctip running for the session.

What to do: See Processes that the agent starts.

The first .NET command prints a PATH message. The first dotnet command prints Failed to add '...\.dotnet\tools' to the PATH environment variable. and continues.

What to do: No action needed.

pnpm 12 needs a store that the agent can write. pnpm 12 can't install from a read-only store, and fails with ERR_PNPM_NO_OFFLINE_TARBALL.

What to do: Set the pnpm store to a folder that the agent can write.

Internet and downloads

Downloads fail while the agent's internet access is off. Package managers, git clone over HTTPS, and other downloads fail. Some tools report the block in ways that hide the cause:

  • Connections fail with An attempt was made to access a socket in a way forbidden by its access permissions, or curl exits with code 7.

  • npm reports EACCES, which looks like a file permission problem.

  • Some package managers retry before they give up: pip and cargo for about 11 seconds, dotnet for about 9 seconds, and npm for about 75 seconds.

What to do: Ask your administrator to turn on internet access for the agent, or to stage the package caches and tool downloads that your projects need, such as the npm cache, a pip wheelhouse, vendored crates, a NuGet folder, Maven and Gradle caches, and the Go module cache. Builds work offline from staged caches. dotnet restore also works when the packages are already in the agent's NuGet cache.

The agent can't connect to servers on the WorkSpace while its internet access is off. This includes servers that the agent starts itself and servers that you start, on the loopback address, the WorkSpace's own IP address, or its host name. The agent can start a development server, but each connection to it fails at once with error 10013, and curl exits with code 7. You can still connect to the agent's server.

What to do: Connect to the server yourself. If the agent needs to connect to it, ask your administrator to turn on internet access for the agent.

Some DNS tools time out while the agent's internet access is off. nslookup times out after about 10 seconds. Name resolution in other tools keeps working.

What to do: Don't treat an nslookup timeout as a sign that a name doesn't exist. Use Resolve-DnsName instead of nslookup.

With internet access on, code that the agent downloads can run. When your administrator turns on internet access for the agent, the agent and the programs that it starts can download packages, tools, and other code and run it. That code runs as the agent's account, with the same limits as the agent.

What to do: Review what the agent installs, and read each approval request before you approve it.

Processes that the agent starts

taskkill fails for the agent, and some build processes keep running. taskkill fails with ERROR: Access denied in every form, also on the agent's own processes. Get-CimInstance and Get-WmiObject fail the same way. After builds, some processes keep running: dotnet and VBCSCompiler after dotnet build, mspdbsrv and vctip after MSVC builds, vctip after cargo build, the Gradle daemon, and Node.js servers. They use memory and can hold ports and file locks until the session ends. When the agent's session ends, the processes that it started end too.

What to do:

  • Stop one process with Stop-Process -Id id -Force, or stop by name, for example Stop-Process -Name dotnet,VBCSCompiler,mspdbsrv,vctip -Force. Stopping by name stops every process with that name that the agent started, including one that another command still uses.

  • Use the tool's own stop command where there is one: dotnet build-server shutdown, or gradle --stop.

  • Change scripts that call taskkill to use Stop-Process.

  • To end the processes that a long session left behind, end the agent's session.

Editors, SDKs, and ACP clients

Tools that start the agent must use the wrapper. An editor, SDK, or ACP client gets the agent's restrictions only when it starts the agent through the agent-ready WorkSpaces wrapper, C:\Program Files\Amazon\AgenticWorkspaces\wrapper\claude.exe. Each of these tools comes with its own copy of Claude Code. A copy that starts any other way runs as you, without the agent's restrictions.

What to do: Set the wrapper as the Claude Code executable in each tool:

Tool Setting

Claude Agent SDK for TypeScript

pathToClaudeCodeExecutable

Claude Agent SDK for Python (Boto)

cli_path

ACP adapter for Claude Code

CLAUDE_CODE_EXECUTABLE environment variable

Claude Code extension for Visual Studio Code

claudeCode.claudeProcessWrapper

Through the wrapper, the agent's approval requests go to that tool, and the tool's allow and deny decisions apply. A program built with an SDK can approve requests without asking you.

An ACP session might not send approval requests. An ACP session can start in a permission mode that doesn't send approval requests to the client.

What to do: If you want the agent to ask before it acts, have the client set the session mode, for example to default.

Some Visual Studio Code helper calls fail through the wrapper. A few short helper calls from the Claude Code extension fail when it runs through the wrapper.

What to do: No action needed. Chat works through the wrapper and asks for approval as normal.

Some editors start a project's MCP servers as you. The built-in GitHub Copilot runtime in Visual Studio Code starts the MCP servers listed in a project's .mcp.json as you, outside the agent's restrictions, when you open the folder. This happens even if nobody is signed in to Copilot.

What to do: Open only folders whose MCP configuration you trust.

Claude Code behavior

In auto mode, Claude Code can refuse some actions before they run. Claude Code's classifier can refuse:

  • Scripts whose names or options suggest deleting files, when it hasn't read the script's contents, and scripts that move files into a denied folder.

  • Scripts that it hasn't read that test network access or list folders.

  • Stopping processes by a name pattern, as an action that could affect processes across the machine.

  • Writes that change settings for later sessions, such as .claude\settings.local.json, or the agent's own settings.

  • On a first try, icacls on your profile folder, and scripts run with -ExecutionPolicy Bypass.

The model can also decline a task that it reads as getting around a policy.

What to do: In your prompt, name the exact paths that a script touches and what each option does. Have the agent stop processes by their process IDs. For a settings write that you want, confirm it in your prompt, or write the file yourself.

Glob needs forward slashes. Claude Code's Glob tool finds nothing when a pattern has backslashes.

What to do: Use forward slashes or a plain path in Glob patterns.

Related topics