Back to skill

Security audit

Protocol Deviation Classifier

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned and non-malicious, but it has review-worthy issues in a clinical compliance workflow: an unnecessary unpinned install step, under-documented output categories, and fail-open risk defaults that can understate serious deviations.

Review carefully before installing or using in a clinical quality workflow. Avoid running the pip install step unless the dependency list is fixed or removed, treat all outputs as advisory only, and require human QA review especially for missing or malformed risk-factor inputs and any downstream process expecting only major/minor labels.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unnecessary and Unpinned PyPI Dependencies Create a Supply-Chain Risk

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.py:86
Finding

Missing Risk Factors Are Converted to Benign Values and Bypass Automatic Assessment

Content
View full analysis
'DeviationEvent': """从字典创建事件""" def parse_risk(value): if isinstance(value, str): try: return RiskLevel(value.lower()) except ValueError: return RiskLevel.NONE return RiskLevel.NONE factors = data.get('severity_factors', {}) return cls( id=data.get('id', ''), description=data.get('description', ''), deviation_type=data.get('type', data.get('deviation_type', '')), occurrence_date=data.get('occurrence_date'), site_id=data.get('site_id'), subject_id=data.get('subject_id'), safety_impact=parse_risk(factors.get('safety_impact', 'none')), data_impact=parse_risk(factors.get('data_impact', 'none')), scientific_impact=parse_risk(factors.get('scientific_impact', 'none')) ) ``` `scripts/main.py:320-339`: ```python def classify_batch(self, events: List[Dict]) -> List[ClassificationResult]: """ 批量分类偏差事件 Args: events: 偏差事件字典列表 Returns: List[ClassificationResult]: 分类结果列表 """ results = [] for event_data in events: event = DeviationEvent.from_dict(event_data) result = self.classify( description=event.description, deviation_type=event.deviation_type, event_id=event.id, safety_impact=event.safety_impact, data_impact=event.data_impact, scientific_impact=event.scientific_impact ) results.append(result) return results ``` `scripts/main.py:732-740`: ```python classify_parser.add_argument("--safety-impact", ...[truncated 3378 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented purpose says the skill performs a binary major/minor classification, but the content also describes critical deviations, report generation, and interactive workflows. This mismatch can cause agents or users to invoke the skill under incorrect assumptions, leading to over-broad behavior, unsafe automation, or outputs being used for regulatory decisions beyond the intended scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation acknowledges file read/write behavior but does not declare an explicit tool scope such as permissions or allowed-tools. This creates an authorization gap where an agent runtime may grant broader filesystem access than reviewers or users expect, increasing the chance of unintended data access or overwriting files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger text says the skill should be used 'when classification assessment of protocol deviations is needed,' which is a general condition rather than a specific invocation scope. It does not define precise trigger phrases, boundaries, or exclusion conditions, so it could overlap with many routine discussions of clinical trial deviations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python skill includes natural-language descriptions and operational output primarily in Chinese, and the interactive/CLI experience continues that fixed-language behavior elsewhere in the file. Under the policy rule for language/locale, forcing a specific language without user opt-in is a violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill determines whether an incident is a 'major deviation' or 'minor deviation', but the implementation introduces and emits a third 'critical' outcome. This interface/behavior mismatch can break downstream automation, regulatory workflows, or policy logic that assumes a closed two-class decision, causing misrouting or unhandled cases in a clinical compliance context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The feature list advertises 'Chinese Support: Full support for Chinese clinical trial scenarios,' which introduces a locale-specific behavior without stating whether users can choose other languages or locales. Under the policy, locale constraints should be opt-in or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
60% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
dataclasses
enum

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
60% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
dataclasses
enum

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest centers on classifying a deviation incident and assessing its impact, but this code also produces summary reports, category breakdowns, rates, and portfolio-level recommendations across batches of incidents. That is broader quality-management reporting functionality, not just per-incident classification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.