LLM Excessive Agency
Description
Detects LLM implementations with excessive autonomy that can lead to unintended consequences. OWASP LLM08 - Excessive Agency. Excessive agency occurs when LLMs are granted: - Ability to perform destructive operations without confirmation - Auto-execution of LLM-generated code or commands - Direct database modifications without approval - Financial transactions without human oversight - Email/communication sending without review This rule detects: - Auto-execution of tool calls without human approval - Destructive operations (delete, update, send) without confirmation - Autonomous agent loops without termination controls - Missing human-in-the-loop for sensitive operations
What Shoulder detects
How to fix
Require human approval for sensitive operations and set iteration limits on agent loops.
```javascript
if (SENSITIVE_OPERATIONS.has(toolName)) {
await queueForApproval(toolCall);
} else {
await executeSafeToolCall(toolCall);
}
```
Learn more: https://shoulder.dev/learn/javascript/cwe-862/llm-excessive-agency
Applies to
Languages
Frameworks
nodejs
express
References
Scan for this issue
Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=javascript-llm-excessive-agency .