{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":24372,"path":"intelligent-experiences/prevent-changes-sandbox.md","title":"Prevent changes to sandbox files","bundle":null,"doc_type":null,"release":"australia","body":"\n# Prevent changes to sandbox files\n\nAdd a filesystem deny rule to your sandbox policy so that agent actions can't modify files in the sandbox runtime directory on user devices.\n\n## Before you begin\n\nRole required: sn\\_app\\_cowork.admin\n\n## About this task\n\nCowork runs agent commands in an isolated sandbox. The sandbox reaches permitted files on the device through an authenticated file bridge, which is how tasks such as reading and saving documents work.\n\nIn affected releases, the file bridge doesn't prevent writes to the sandbox runtime directory. Cowork launches sandbox components from this directory when it creates a sandbox, so a replaced file there can run on the device with the privileges of the user running Cowork, outside the sandbox restrictions. The deny rule blocks these writes until you deploy a release that contains the permanent fix.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **ServiceNow Cowork** &gt; **Policies** &gt; **Cowork Agent Policy**.\n\n2.  Open the policy assigned to your affected Cowork users.\n\n3.  Select the **Policy Sandbox Rules** tab, and then select **New**.\n\n4.  In the **Sandbox Rule** field, select a sandbox rule.\n\n5.  In the **Domain** field, select the domain.\n\n6.  Select **Submit**.\n\n7.  In the **Policy Sandbox Rules** tab, select the rule you created.\n\n8.  Configure the rule.\n\n    1.  From the **Rule type** list, select **filesystem**.\n\n    2.  From the **Access mode** list, select **deny**.\n\n    3.  In the **Path** field, enter `.local/share/openshell/vm-runtime`.\n\n        Enter the path exactly as shown. The path is relative to the user's home directory. Don't add `~/`, environment variables, or wildcard characters. Apply the rule to the directory itself, not to a version folder or a file, because each new version creates its own subfolder.\n\n9.  Select **Update**.\n\n10. Sync the policy to your Cowork clients.\n\n11. Verify the rule.\n\n    1.  Confirm the rule is active and linked to the correct policy.\n\n    2.  Confirm each affected client received the rule.\n\n    3.  In a test environment, confirm that writes to the protected directory are denied.\n\n    4.  Confirm that normal file tasks outside that directory still work.\n\n    A device is protected only after it receives and applies the policy. If verification fails, resolve the policy or sync issue before you treat the device as protected.\n\n    **Important:** Don't test the rule by overwriting, renaming, deleting, or running a real sandbox runtime file, because this can break the sandbox on that device. Use a separate test file in a test environment.\n\n    If your deployment uses a custom sandbox runtime location, add a separate deny rule for that location. Contact ServiceNow Support to confirm the path.\n\n\n## Result\n\nAgent actions can't write to the sandbox runtime directory. Typical tasks are unaffected: users can open permitted documents, process them in the sandbox, and save results to permitted locations. Before wide deployment, validate your business critical workflows and any custom skills in a test environment.\n\n**Note:**\n\nThe rule protects the configured path for operations that the sandbox policy controls. It doesn't cover:\n\n-   Custom runtime locations, unless you add rules for them\n-   Other processes that run on the device under the same user account\n-   Runtime files that were modified before you applied the rule\n\nApproval prompts add oversight but don't replace this rule.\n\n## What to do next\n\nKeep the rule in place until a release that contains the permanent fix is deployed to all affected devices and you verify protection on them. Remove the rule only through your normal change approval process.\n\nIf you suspect a runtime file on a device was already modified, follow your organization's security incident process and reinstall Cowork from a trusted source on that device.\n\n**Parent Topic:**[ServiceNow Cowork reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/servicenow-cowork-reference.md)\n\n"}}