惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
G
Google Developers Blog
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
"os.system(f'pip install {library}')"
roberta carr · 2026-04-25 · via DEV Community

roberta carraro

Update: This was found in an older version of CrewAI's code interpreter. CrewAI has since removed the tool entirely. The finding is real but historical. The point is the class of problem, not the specific instance.


I've been building a static effect analyzer. You point it at a Python or TypeScript file and it tells you what each function does to the outside world: network, filesystem, database, subprocess, etc.

I ran it on CrewAI's code interpreter and got this:

$ libgaze check code_interpreter.py

  run_code_unsafe:347  can Unsafe
    365 | os.system(f"pip install {library}")
    370 | exec(code, {}, exec_locals)

2/13 functions are pure.

Enter fullscreen mode Exit fullscreen mode

Line 365. library is a string from the LLM. No validation, no allowlist. The LLM decides what gets pip-installed on your machine via os.system with an f-string.

The function is honestly named run_code_unsafe. But the function that calls it, _run, is 150 lines long and picks between the "safe" and "unsafe" paths based on a config flag. The tool traces the call graph and shows that _run inherits Unsafe:

  _run:194  can Fs, Net, Unsafe

Enter fullscreen mode Exit fullscreen mode

If A calls B and B is Unsafe, A is Unsafe. You can't hide it behind indirection.

How it works

There are ten effects. Fixed list, not extensible:

Net Fs Db Console Env Time Rand Async Unsafe Fail

The analyzer does two passes. First, walk the AST and check every call against a table of known effects (os.system is Unsafe, requests.get is Net, open() is Fs, etc.). Second, propagate through the call graph within the file. Iterate until stable.

No type inference. No cross-file analysis. Just the AST and a vocabulary. It's enough to find the CrewAI thing and a lot of things like it.

I scanned 15,293 functions across CrewAI, LangChain, AutoGPT, MCP Servers, Vercel AI SDK, and OpenAI Agents JS. The same ten effects worked for all of them. Didn't add or remove a single one between Python and TypeScript.

Try it

pip install libgaze
libgaze check your_file.py

Enter fullscreen mode Exit fullscreen mode

npm install -g libgaze-ts
libgaze-ts check your_file.ts

Enter fullscreen mode Exit fullscreen mode

Zero dependencies on the Python side. 2.4MB on the TypeScript side (oxc-parser, not the full TypeScript compiler).

Both support --json, directory scanning, --deny for CI gating, and .gazepolicy files for per-function rules. There's a GitHub Action too.

The repo is github.com/itchymutt/gaze. MIT licensed.

If you run it on something and find something interesting, let me know.