monte-carlo-instrument-agent — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited monte-carlo-instrument-agent (Agent Skill) and scored it 92/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 2 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 2 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill walks an MC Agent Observability customer through instrumenting a new AI agent in their Python codebase: detect AI libraries → install the Monte Carlo OpenTelemetry SDK + matching instrumentors → generate mc.setup() (with SimpleSpanProcessor when serverless) → propose @trace_with_workflow / @trace_with_task decorator diffs → confirm env vars (only when needed) → verify traces flow via get_agent_metadata.
The skill produces traces. It is not for monitoring or alerting on existing traces — that's monte-carlo-monitoring-advisor. The two skills are sequential: instrument-agent first, monitoring-advisor afterward.
Monte Carlo tool routing (required): Always call Monte Carlo MCP tools through this plugin's bundled server, whose fully-qualified tool names aremcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool>(e.g.mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__get_alerts). Bare tool names used in this skill (get_alerts,search,get_table, …) refer to that bundled server. If the session also has a separately-configuredmonte-carlo-mcpserver, do not route to it — it may point at a different endpoint or credentials.
Reference files live next to this file. Use the Read tool (not MCP resources) to access them.
This skill must not modify any file in the customer's codebase without explicit per-file user approval. This rule covers:
requirements.txt, pyproject.toml, Pipfile, lockfiles. Always propose the diff and wait for confirmation before editing.mc.setup() insertion, decorator placement (@trace_with_workflow, @trace_with_task), import additions. Always propose the diff and wait for confirmation per file..env, .envrc, shell rc files. Always propose the change and wait for confirmation before editing.The skill walks the user through what needs to change and why, then proposes diffs. It does not apply edits, run pip install, or write env files autonomously. The only exception: the user may explicitly waive approval for a specific file ("I know the risks, just edit the file") — proceed for that file only and surface that the approval was waived.
This guardrail is reinforced in the Tier-3 references (references/decorator-placement.md, references/setup-template.md, references/library-detection.md).
Activate when the user expresses intent to instrument a new AI agent:
https://pypi.org/project/montecarlo-opentelemetry/)mc.setup() (when generating; not when diagnosing)Do not activate when the user is:
monte-carlo-monitoring-advisormonte-carlo-incident-response / monte-carlo-analyze-root-causepush-ingestionconnection-auth-rulesreferences/troubleshooting.md, but the first invocation should be deliberate (not a coverage question)If the user is ambiguous ("set up agent observability"), surface both options and ask whether they're instrumenting a new agent (this skill) or configuring monitors on an existing one (monitoring-advisor).
Before walking the workflow, confirm two things:
test_connection. If it succeeds, Step 4 (BEFORE snapshot) and Step 10 (AFTER verification) will use get_agent_metadata directly. If test_connection fails, degrade gracefully — point the user at the MC MCP setup docs (https://docs.getmontecarlo.com/docs/mcp-server) as informational, then continue the workflow and tell them they'll need to verify the new agent appears in the Monte Carlo UI manually after running the instrumented agent. Record whether MCP is available so Steps 4 and 10 know which path to take.requirements.txt, pyproject.toml, or Pipfile in the working directory. If none exist, ask the user where the agent codebase is.The skill is structured as a Tier 1 router (this file) → Tier 2 workflow → Tier 3 per-step references. Load each reference when its step is reached in the workflow.
| Reference file | Load when… |
|---|---|
references/workflow.md | At the start of every invocation. Tier 2 — the end-to-end flow. Read first. |
references/library-detection.md | Walking step 1 of the workflow — detecting AI libraries, the runtime style (serverless vs long-running), and any existing mc.setup(). Documents how detect_libraries.py and fetch_sdk_docs.py recognize supported AI libraries — the SDK's supported set is whatever PyPI shows. |
references/setup-template.md | Walking step 5–7 of the workflow — resolving the OTLP endpoint, generating mc.setup(), handling the existing-mc.setup() decision matrix. Includes both serverless and long-running templates. |
references/decorator-placement.md | Walking step 8 of the workflow — proposing @trace_with_workflow and @trace_with_task diffs. Tier 3: those are the only two decorators in scope for v1. |
references/verify-traces.md | Walking step 4 (BEFORE snapshot) and step 10 (AFTER verification) of the workflow — both get_agent_metadata calls. Documents dev/prod twin disambiguation via MCON. |
references/redaction.md | When the customer has stricter privacy requirements (compliance, regulated workload, contractual PII restrictions) and asks to redact prompts or completions. Walks through ordered redaction layers: env-var disable first, then optional placeholder-substitution via mc.create_llm_span. |
references/troubleshooting.md | When step 10's verification doesn't show the new agent, or the user reports incomplete traces. Covers the common trace-ingestion failure modes plus the serverless SimpleSpanProcessor foot-gun. |
The full step-by-step flow lives in references/workflow.md. At a glance:
mc.setup() via scripts/detect_libraries.py.get_agent_metadata (BEFORE any code changes)./v1/traces).https://pypi.org/project/montecarlo-opentelemetry/ if the fetch fails).SimpleSpanProcessor.MCD_DEFAULT_API_ID / MCD_DEFAULT_API_TOKEN or OTEL_EXPORTER_OTLP_HEADERS, depending on the setup template. Presence-only check; never read or echo the values.get_agent_metadata (AFTER user runs the instrumented agent) — confirm new agent_name + new MCON appears.references/troubleshooting.md.Each step's full Tier 3 details live in the reference files above.
The skill ships two Python helpers under scripts/ that the workflow invokes:
| Script | Purpose |
|---|---|
scripts/detect_libraries.py | Parse requirements.txt / pyproject.toml / Pipfile into a sorted dependencies list; classify runtime as serverless / long-running / unknown; detect existing mc.setup(). Returns JSON. Raw discovery surface — does not match AI libraries to instrumentors; that's the LLM's job using fetch_sdk_docs.py output. |
scripts/fetch_sdk_docs.py | Fetch the SDK supported-instrumentor list live from PyPI, including version constraints. Fails closed if PyPI is unreachable. |
Version constraints for instrumentor packages come from PyPI live (fetch_sdk_docs.py). Transitive constraints PyPI doesn't expose (e.g. wrapt<2 for OpenLLMetry instrumentors at <=0.53.4) are documented as symptom-driven fixes in references/troubleshooting.md — the skill surfaces them when the customer hits the symptom rather than baking them into every install diff.
create_llm_span boilerplate for libraries without a dedicated instrumentor.references/redaction.md.@trace_with_workflow and @trace_with_task. Other tracing primitives the SDK exposes are not part of the v1 surface.| Command | Purpose |
|---|---|
/instrument-agent | Kicks off the workflow against the current Python codebase. |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.