Güvenlik ve İzinler Orta
Salt Okunur Ajan
HEM allowedTools HEM de disallowedTools kullanarak Claude'u salt okunur dosya erişimine kilitleyin — doğru kalıp
Komut
$ "color:#7C5CFC">claude -p "Analyze this codebase ">for security issues" \ "color:#d97757">--allowedTools "Read,Grep,Glob" \ "color:#d97757">--disallowedTools "Write,Edit,Bash,WebFetch,WebSearch" \ "color:#d97757">--permission-mode bypassPermissions \ "color:#d97757">--output-format json
Yanıt
{
"subtype": "success",
"result": "## Security Analysis\nFound 3 potential issues...",
"num_turns": 4,
"permission_denials": []
} Ayrıştırma Kodu
059669">">const data = JSON.parse(execFileSync(059669059669">">'claude', [ 059669059669">">'-p', 059669059669">">'Analyze codebase', 059669059669">">'--allowedTools', 059669059669">">'Read,Grep,Glob', 059669059669">">'--disallowedTools', 059669059669">">'Write,Edit,Bash,WebFetch,WebSearch', 059669059669">">'--permission-mode', 059669059669">">'bypassPermissions', 059669059669">">'--output-format', 059669">'json' ], opts));
Tuzaklar
! HEM --allowedTools HEM --disallowedTools kullanılmalıdır — yalnızca --allowedTools ile Claude dosya yazmak için Bash'e geri döner
! Bu, gerçek anlamda salt okunur bir ajan için doğru kalıptır