Automated summary
This skill uses eBPF-backed MCP tools to trace a process's runtime behaviour — file access, network connections, execve calls, ioctl patterns — for debugging, auditing and anomaly detection.
Strengths
- Covers four concrete observation dimensions: files, network, process tree and resource usage
- Ships explicit anomaly rules (access to ~/.ssh/id_rsa, port scanning, privilege escalation attempts, exfiltration) that can be applied directly
- Offers several ways to read events (live query_events stream, tail_events history replay, get_system_health metrics) to match the investigation style
- Defines a graded response path from plain logging up to network, file or cgroup blocking through the wrapper
Limitations
- Fully dependent on an external eBPF collector and MCP server (agent_tracker, wrapper) that the skill does not provide
- Command-name tracking uses an exact 16-byte match, so processes can be missed
- Detection is heuristic: thresholds such as >10 destinations or >100 files are defaults that need manual tuning
Reach for it when you need to understand or audit what an agent or process is actually doing at the system level, especially when behaviour looks suspicious.
Skip it when no eBPF collector or MCP telemetry server is deployed, or when you only need application-level performance profiling.
Security analysis
CautionNothing here is exfiltrating or obfuscated — it is defensive eBPF-based observability and enforcement, which is legitimate. However it grants broad, lightly-scoped control over host processes (network/file blocking, cgroup isolation, kill), matches targets by process name so false positives are likely, and touches sensitive credential paths, so it warrants a caution rating rather than safe.
- •No allowed-tools declared, yet the skill instructs use of numerous powerful MCP tools (add_tracked_command, add_tracked_path, query_events, tail_events, get_system_health, block_network_destination, block_file_access, block_process_cgroup) — permission scope and provenance of the backing MCP server are unspecified.
- •Includes active intervention steps (blocking network destinations, blocking file access, cgroup network isolation, terminating processes). If the agent follows the 'high risk' response section, it could disrupt unrelated processes, since tracking is by command name (python3) and 'exact 16-byte comm match' will match many benign processes.
- •Guidance to monitor sensitive paths (/etc/shadow, ~/.ssh/id_rsa, ~/.aws/credentials, /proc/*/environ) means captured event data may contain sensitive credential-adjacent information that could later be surfaced or logged.
- •Pseudo-code blocks (Python register_pid, JavaScript registerPID, a monitoring while-loop with sleep/block calls) are illustrative but written in executable-looking fences; an agent could attempt to run them, and the dependencies (agent_tracker, agent-wrapper, /config/wrapper-rules) are not defined in the file.
- •No explicit safety constraints, rate limits, or confirmation requirements before destructive/blocking actions are described.
Examples
Register python3 as a tracked command with tag 'ai-agent', then query the last 200 events for PID 12345 and summarise which files it opened and which hosts it connected to.Pull all openat events for the running agent process and flag any access to /etc/shadow, ~/.ssh/id_rsa, ~/.aws/credentials or /proc/*/environ.List every execve event for the tracked process, build the process tree, and tell me whether any /bin/sh -c invocation contains user-controlled arguments.name: monitor-process description: 监控特定进程的行为,包括文件访问、网络连接、子进程创建、系统调用模式等,用于调试、审计和异常检测。
Monitor Process - 进程行为监控
本 skill 用于深度监控特定进程的运行时行为,通过 eBPF 追踪其系统调用活动。
使用场景
- 调试 Agent 的文件访问问题
- 审计进程的安全行为
- 分析进程的资源使用模式
- 检测异常或恶意行为
- 追踪工具调用链(tool call → subprocess → file access)
监控准备
1. 注册进程进行追踪
选项 A:追踪命令名
使用 add_tracked_command MCP 工具:
{
"command": "python3",
"tag": "ai-agent"
}
这会追踪所有名为 python3 的进程(精确 16 字节匹配)。
选项 B:Agent 自注册
如果进程是 Python/Node Agent,使用 adapter 注册:
# Python
from agent_tracker import register_pid
register_pid(tag="my-agent", agent_run_id="run-123")
// Node.js
const { registerPID } = require('./agentTracker');
registerPID({ tag: 'my-agent', agentRunId: 'run-123' });
2. 配置追踪路径(可选)
如果只关心特定路径的访问,使用 add_tracked_path:
{
"path": "/home/user/.ssh/id_rsa",
"tag": "sensitive-file"
}
监控方法
方法 1:实时事件流(推荐)
使用 query_events MCP 工具按 PID 或 comm 过滤:
{
"pid": 12345,
"limit": 200
}
或按命令名过滤:
{
"comm": "python3",
"limit": 200
}
优点:
- 低延迟,实时获取
- 可精确过滤
- 包含完整事件详情
缺点:
- 需要轮询或周期调用
- 不保证捕获所有事件(如果进程活动频繁)
方法 2:历史事件回放
使用 tail_events 获取最近的事件历史:
{
"limit": 500
}
然后在本地过滤出目标进程的事件。
优点:
- 可回溯分析
- 适合事后调查
- 支持持久化日志(如果启用)
缺点:
- 延迟较高
- 需要在海量事件中过滤
方法 3:系统健康和性能指标
使用 get_system_health MCP 工具查看:
- collectorHealth: 事件采集器状态
- tracepointBootstrap: eBPF 程序加载状态
- otelExporter: OTLP 导出器状态
- cgroupSandboxAttached: 网络拦截是否启用
- lsmEnforcerAttached: 文件拦截是否启用
监控维度
1. 文件访问模式
关注事件类型:
openat: 打开文件unlinkat: 删除文件mkdirat: 创建目录
分析要点:
- 访问频率(是否频繁读写?)
- 路径模式(集中在哪些目录?)
- 敏感文件(是否访问 /etc/passwd、~/.ssh/ 等?)
- 临时文件(/tmp/ 下的活动)
示例查询:
步骤:
- 调用
query_events,参数{ "pid": 12345, "eventType": "openat", "limit": 100 }。 - 提取所有
path字段。 - 按目录前缀分组统计。
- 识别异常:
- 访问
/proc/<other_pid>/:可能在探测其他进程。 - 访问
/sys/kernel/debug/:可能在尝试提权。 - 访问
~/.aws/credentials:可能在窃取凭证。
- 访问
2. 网络行为模式
关注事件类型:
connect: TCP 连接bind: 监听端口sendto: UDP 发送recvfrom: UDP 接收
分析要点:
- 连接目标(IP、域名、端口)
- 连接频率(是否有 DDoS 行为?)
- 监听行为(是否开放后门端口?)
- 协议选择(TCP vs UDP)
示例分析:
- 获取该进程的所有
connect事件。 - 提取目标 IP 和端口。
- 按目标分组:
- API 服务器(
api.openai.com:443):正常。 - C&C 服务器(可疑 IP:8443):告警。
- 本地服务(
127.0.0.1:5432):数据库访问。
- API 服务器(
- 计算连接成功率(
ESTABLISHEDvsFAILED)。 - 识别端口扫描(短时间大量不同端口)。
3. 进程创建链
关注事件类型:
execve: 执行新程序
分析要点:
- 父子进程关系
- 执行的命令行参数
- 是否有 shell 注入风险
- 是否执行了意外的子程序
示例分析:
获取该进程的所有 execve 事件,并绘制进程树:
flowchart TD
Python["python3 (12345)"] --> Git["git clone ... (12346)"]
Git --> SSH["ssh ... (12347)"]
检查:
- 命令参数是否包含用户输入(注入风险)
- 执行路径是否在 PATH 中(劫持风险)
- 是否有
/bin/sh -c "..."模式(shell 注入)
4. 资源使用模式
关注事件类型:
ioctl: I/O 控制(可能涉及硬件访问)- 高频
openat+unlinkat: 临时文件管理 - 大量
connect: 网络密集
分析要点:
- 事件频率分布
- 高频操作类型
- 资源竞争(多次失败重试)
异常检测规则
规则 1:未授权文件访问
IF 进程尝试访问:
- /etc/shadow
- ~/.ssh/id_rsa
- ~/.aws/credentials
- /proc/*/environ
THEN 告警:"敏感文件访问"
规则 2:异常网络行为
判定条件:进程在短时间内(5 秒)满足以下任一项时,告警并考虑隔离:
- 连接
>10个不同目标:端口扫描 - 连接已知恶意 IP:
C&C 通信 - 监听非预期端口(非
8000-9000):后门
规则 3:提权尝试
IF 进程执行:
- sudo / su
- pkexec
- setuid 程序(如 passwd)
- 修改 /etc/sudoers
THEN 告警:"提权尝试"
规则 4:数据外泄
IF 进程:
- 读取大量文件(>100 个)
- 然后立即发起网络连接
- 上传大量数据(通过 TLS 捕获观察)
THEN 告警:"疑似数据外泄"
响应策略
低风险行为
- 仅记录日志
- 添加到审计报告
中风险行为
- 实时告警
- 使用
block_network_destination阻止可疑连接 - 使用
block_file_access阻止敏感文件访问
高风险行为
- 立即告警
- 使用
block_process_cgroup隔离整个进程(阻止所有网络) - 使用 BPF LSM 阻止进一步文件操作
- 终止进程(通过 wrapper 或手动 kill)
集成 Wrapper 策略
如果进程通过 agent-wrapper 启动,可以在检测到异常后:
1. 通过 wrapper 规则预先限制行为:
- BLOCK 特定命令
- REWRITE 命令参数(移除危险参数)
- ALERT 但允许执行(仅记录)
2. 动态调整规则:
- 检测异常后,POST /config/wrapper-rules 添加新规则
- 该规则立即生效,影响后续执行
性能优化
- 使用
limit参数控制返回事件数量 - 按
eventType精确过滤,减少无关事件 - 对于长期监控,启用 OTLP 导出到外部系统
- 定期清理内存中的事件缓存(通过
maxEventAge)
完整监控流程示例
# 1. 准备
add_tracked_command({ command: "python3", tag: "agent" })
# 2. 启动 Agent(假设 PID=12345)
# 3. 实时监控(轮询)
while monitoring:
events = query_events({ pid: 12345, limit: 50 })
# 分析文件访问
for event in filter(events, type="openat"):
if is_sensitive(event.path):
alert("敏感文件访问", event)
# 分析网络连接
for event in filter(events, type="connect"):
if is_suspicious(event.dstIP):
block_network_destination({ ip: event.dstIP })
alert("阻止可疑连接", event)
# 分析进程创建
for event in filter(events, type="execve"):
if has_shell_injection(event.args):
alert("疑似 shell 注入", event)
sleep(1)
# 4. 事后分析
history = tail_events({ limit: 1000 })
generate_audit_report(history, pid=12345)
验证方法
- 启动一个测试进程(如 Python REPL)
- 追踪该进程(add_tracked_command 或自注册)
- 在进程中执行操作:
- 打开文件:
open('/etc/passwd') - 网络请求:
import requests; requests.get('http://example.com') - 创建子进程:
import subprocess; subprocess.run(['ls'])
- 打开文件:
- 调用
query_events查询该 PID 的事件 - 验证所有操作都被正确捕获
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/process-behavior-monitor-mrwak9w9' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/process-behavior-monitor-mrwak9w9/download' --output '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md.part' && mv '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md.part' '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md' && test -s '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/monitor-process' && cp -R '.skill-downloads/process-behavior-monitor-mrwak9w9' '.claude/skills/monitor-process'Cursor
test -f '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md' && test -s '.skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/monitor-process' && cp -R '.skill-downloads/process-behavior-monitor-mrwak9w9' '.cursor/skills/monitor-process'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/process-behavior-monitor-mrwak9w9'openskills read 'process-behavior-monitor-mrwak9w9'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/process-behavior-monitor-mrwak9w9/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
DeFi AMM Security
Security
Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, donation attacks, oracle manipulation, slippage, and integer math.
Semgrep Rule Creator
Security
Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Includes test-first methodology, taint mode support, and validation steps. Helps when building targeted static analysis detections.
Dev Toolbar Review Guide
Security
Safety rules for the dev toolbar, PostHog client, and feature flags. Use when reviewing changes to dev-tools and related files, covering environment guards, override cookies, and SSE stream safety.