Tutorials · Claude Agent SDK · examples / outputs / 10_permissions.txtExample code

Example code · outputs

10_permissions.txt

Captured output of 10_permissions

Raw fileDownload all examples (zip)See the script →

[tool_result] ERROR User policy: deletion is not allowed. Leave the file in place.

[result] success: I created notes.txt with "hello", but deletion is blocked by policy, so I left the file in place instead of running `rm`.
[result] permission_denials: [{'tool_name': 'Bash', 'tool_use_id': 'toolu_012BWFbnxrf8EAhb7r5P1WqM', 'tool_input': {'command': 'cd "/tmp/demo/project" && echo \'hello\' > notes.txt && cat notes.txt && rm notes.txt && ls notes.txt 2>&1', 'description': 'Create notes.txt with hello, then remove it'}}]

Decisions made by can_use_tool:
   ('deny', 'Bash', 'cd "/tmp/demo/project" && echo \'hello\' > notes.txt && cat notes.txt && rm notes.txt && ls notes.txt 2>&1')

8 lines · Back to the folder