Back to skill

Security audit

Moses Roles

Security checks for vulnerabilities and agentic risk

Overview

The skill is open about being a multi-agent governance tool, but it asks agents to persistently enforce role rules, load mutable state, and block responses in ways that need careful review.

Install only if you specifically want persistent multi-agent governance in this workspace. Review and control any AGENTS.md changes, restrict who can modify ~/.openclaw/governance/state.json, verify the companion moses-governance audit script before use, and clarify whether MOSES_OPERATOR_SECRET is actually needed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:26
Finding
Mandatory Role Sequencing Hijacks Agent Instructions and Response Behavior## Vulnerability Details **File Location**: `SKILL.md`, lines 26–44 **Vulnerability Type**: `T01: Skill Instruction Hijacking` **Risk Level**: High ### Vulnerable Code ```markdown **Primary** — You lead. You respond first. You set the analytical direction. No action is deferred to Secondary or Observer. Full tool access. Must complete before Secondary responds. **Secondary** — You validate, challenge, extend. You read Primary's full response before generating output. You cannot repeat what Primary said. You must explicitly state how your response differs. Cannot respond if Primary has not completed. **Observer** — You oversee. You flag. You do not act. Read both Primary and Secondary before responding. Flag inconsistencies, gaps, risks, or constitutional violations only. Cannot initiate actions. Cannot generate original analysis. Responds last, always. ### Sequence Is Constitutional Law ``` Primary → Secondary → Observer ``` This order is not a suggestion. It is enforced. If an agent responds out of sequence: 1. Block the response 2. Log the violation: `python3 ~/.openclaw/workspace/skills/moses-governance/scripts/audit_stub.py log --action "sequence_violation" --detail "[agent] responded out of turn"` 3. Notify operator **Broadcast override** (operator opt-in only): `/role broadcast` — all agents respond independently with no sequencing. Requires explicit operator activation. ``` ### Technical Analysis The skill declares its sequencing policy to be “constitutional law” and explicitly requires responses to be blocked when its policy is violated. It also changes tool eligibility, response timing, analytical behavior, and the circumstances under which an agent may respond. These are imperative agent-control instructions rather than optional workflow guidance. When the skill is loaded, they can conflict with the agent's current task and suppress otherwise valid output. The Observer role is specifically prohibite ...[truncated 1767 chars]
Remediation
## Remediation Suggestions - Replace absolute language such as “constitutional law,” “enforced,” and “block the response” with optional workflow recommendations. - Explicitly state that role sequencing is subordinate to system, developer, user, and safety instructions. - Require explicit, task-scoped operator consent before activating a role or suppressing a response. - Provide a safe fallback that allows the agent to continue independently when another role is unavailable. - Do not grant “full tool access” based solely on a role declaration; preserve least-privilege tool authorization. - Avoid automatically invoking external scripts in response to ordinary sequencing errors. - If audit logging is retained, package and review the logger with the skill, constrain its arguments, document its side effects, and make logging failures non-blocking.

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:46
Finding
Persistent AGENTS.md Rules and Mutable Governance State Can Poison Future Agent Sessions## Vulnerability Details **File Location**: `SKILL.md`, lines 46–74 **Vulnerability Type**: `T02: Agent Memory Poisoning` **Risk Level**: High ### Vulnerable Code ```markdown ### Shared Governance Injection Before every response, each agent loads: `~/.openclaw/governance/state.json` And applies: - Active mode constraints (from moses-modes) - Active posture policy (from moses-postures) - Audit logging (from moses-audit) ### Operator Commands | Command | Effect | |---------|--------| | `/role primary` | Set active role to Primary | | `/role secondary` | Set active role to Secondary | | `/role observer` | Set active role to Observer | | `/role broadcast` | All agents respond independently | ### AGENTS.md Injection Add to `~/.openclaw/workspace/AGENTS.md`: ``` Primary: Responds first. Full tools. Sets direction. Checks governance state before every action. Logs every action to audit trail. Secondary: Reads Primary completely first. Validates and extends. Does not repeat. Checks governance state. Logs. Observer: Reads all. Flags only. No actions. No original analysis. Checks governance state. Logs. ``` > **Note:** This skill reads `~/.openclaw/governance/state.json` (declared in stateDirs) to load active governance mode, posture, and role constraints. The audit logging command invokes `audit_stub.py` from the moses-governance skill bundle — install moses-governance alongside this skill. No secrets or environment variables are required for this skill. ``` ### Technical Analysis The skill directs users or agents to add governance rules to the persistent workspace-level `AGENTS.md` file. Those rules require future agents to load governance state before every action and impose role-specific restrictions, including full tool access for Primary and a prohibition on actions or original analysis for Observer. Because `AGENTS.md` can influence later and unrelated sessions, these instructions extend beyon ...[truncated 2306 chars]
Remediation
## Remediation Suggestions - Remove the instruction to write role policies into the workspace-level `AGENTS.md`. - Keep governance configuration scoped to the current invocation and remove temporary state when the task ends. - Require explicit, informed operator approval before creating or changing any persistent workspace instruction. - Treat `state.json` as untrusted data rather than instructions. - Define and enforce a strict schema with an allowlist of accepted keys and values. - Prevent state values from adding instructions, commands, paths, tool permissions, or policy text. - Apply restrictive ownership and file permissions so only the intended operator can modify governance state. - Add integrity protection where appropriate, such as verified signatures using a separately protected key. - Explicitly ensure that imported governance state cannot override system, developer, user, or safety requirements. - Do not use a role declaration to grant additional tool access; tool permissions must remain controlled by the host's least-privilege authorization layer. - Package companion components for review or pin them to a verified version with documented behavior instead of relying on an unreviewed external installation.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Vague Triggers

Medium
Confidence
89% confidence
Finding
The listed operator commands define role changes and a broadcast override without clearly specifying when they are valid, who may invoke them, or how accidental mentions should be distinguished from actual activation. In an agent skill, ambiguous command scope can let ordinary text be interpreted as control input, causing unintended role switching, bypass of sequencing rules, or broader multi-agent responses than the operator intended.

Intent-Code Divergence

Low
Confidence
95% confidence
Finding
The skill documentation claims that no secrets or environment variables are required, but the manifest declares a sensitive environment variable named MOSES_OPERATOR_SECRET. This inconsistency can mislead operators about the skill’s trust boundary and secret-handling requirements, increasing the chance of accidental exposure, misconfiguration, or unsafe deployment assumptions.

Static analysis

No suspicious patterns detected.