Is instructor safe?
- Python shell/command execution
- Python filesystem write/delete
- Python filesystem read
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
instructor is a PyPI package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators. It can: filesystem read, filesystem write, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 0/100 (low).
instructor 1.17.0
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of instructor's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (4)
The component can run operating-system commands or spawn processes.
result = subprocess.run(
[sys.executable, "-c", script],
capture_output=True,
text=True,
timeout=60,
check=False,
)result = subprocess.run(
cmd, capture_output=True, text=True, cwd=Path(__file__).parent.parent
)Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; avoid shell=True.
The component reads files from disk.
with open(file_path) as file:
with open(file_path_or_buffer) as f:
with open(file_path_or_buffer, "rb") as f:
with open(messages_file) as f:
with open(filepath, "rb") as file:
with open(file, "rb") as file_buffer:
with open(validation_file, "rb") as val_file:
data = base64.b64encode(path.read_bytes()).decode("utf-8")data = base64.b64encode(path.read_bytes()).decode("utf-8")data = base64.b64encode(path.read_bytes()).decode("utf-8")return path.read_bytes()
content = file_path.read_text(encoding="utf-8")
with open(md_file, encoding="utf-8") as f:
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
with open(md_file, encoding="utf-8") as f:
with open(file_path, encoding="utf-8") as f:
with open(output_file, encoding="utf-8") as sitemap_file:
tree = ast.parse(init_path.read_text(encoding="utf-8"), filename=str(init_path))
changelog = (root / "CHANGELOG.md").read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
content = file_path.read_text(encoding="utf-8")
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
os.remove(file_path)
with open(file_path, "w") as f:
with open(file_path, "w") as f:
with open(file_path_or_buffer, "a") as f:
with open(download_file_path, "w") as file:
with open(download_file_path, "w") as file:
with open(output_file, "w") as f:
with open(output_file, "w") as f:
with open(output, "wb") as file:
file_path.write_text(new_content, encoding="utf-8")
file_path.write_text(new_content, encoding="utf-8")
with open(md_file, "w", encoding="utf-8") as f:
with open(file_path, "w", encoding="utf-8") as file:
with open(output_file, "w", encoding="utf-8") as sitemap_file:
output.write_text(notes, encoding="utf-8")
Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
import aiohttp
async with aiohttp.ClientSession() as session:
import requests
import requests
from requests.adapters import HTTPAdapter
from urllib3.connection import HTTPConnection, HTTPSConnection
from urllib3.connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from urllib3.exceptions import NewConnectionError
raise NewConnectionError(self, str(exc)) from exc
session = requests.Session()
Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in instructor.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →