computer-use-engine
Safety middleware for AI computer use agents that monitors, enforces policies, and provides guardrails to enable safe desktop interaction.
README
CUE — Computer Use Enforcer
English | 한국어
The missing safety layer between AI agents and your desktop.
CUE is safety middleware for AI computer use agents. It monitors, enforces policies, and provides guardrails so that AI agents can interact with your desktop — safely and compliantly.
Problem
AI computer use is accelerating fast, but safety infrastructure hasn't kept up:
- Rapid adoption — 40% of enterprises plan to deploy AI computer use agents by end of 2026
- No guardrails — only 50% of organizations have any safety controls for autonomous agents
- Regulation is coming — the EU AI Act (Aug 2026) mandates human oversight for high-risk AI systems
There is no open-source framework that sits between AI agents and the desktop to enforce safety policies. CUE fills that gap.
What CUE Does
┌─────────────────────────────────┐
│ Any AI Agent │ Claude, GPT, Agent-S, ...
│ (natural language in/out) │
└──────────┬──────────────────────┘
│ MCP protocol (stdio)
┌──────────▼──────────────────────┐
│ CUE — Computer Use Enforcer │ ← this project
│ ┌────────────────────────────┐ │
│ │ Policy Engine │ │ risk classification, action filtering
│ │ Guardrails │ │ app blocklist, key blocking, rate limits
│ │ Audit Logger │ │ JSONL compliance trail
│ │ Monitor (coming soon) │ │ real-time dashboard & event streaming
│ └────────────────────────────┘ │
└──────────┬──────────────────────┘
│ pyautogui / pygetwindow / pywin32
┌──────────▼──────────────────────┐
│ Desktop OS │
└─────────────────────────────────┘
Core Value Proposition
| Capability | Status | Description |
|---|---|---|
| Action Guardrails | Available | App blocklist, key blocking, per-session action limits |
| Audit Logging | Available | Every action logged to JSONL for compliance review |
| FAILSAFE | Available | Mouse to (0,0) aborts immediately |
| Policy Engine | Phase 1 | Risk classification, rule-based action filtering |
| Real-time Monitor | Phase 2 | Live dashboard with event streaming |
| Human-in-the-Loop | Phase 3 | Approval workflows for high-risk actions |
| Agent Adapters | Phase 4 | Agent-agnostic backends (Claude, GPT, open-source) |
| Compliance Reports | Phase 5 | Automated audit reports for EU AI Act, SOC 2 |
Quick Start
1. Install
git clone https://github.com/yonghwan1106/computer-use-engine.git
cd computer-use-engine
pip install -e .
2. Register with Claude
python scripts/register.py
This automatically adds CUE to both Claude Desktop and Claude Code configurations.
3. Restart Claude and go
Restart Claude Desktop or Claude Code. Then just ask:
"Take a screenshot of my screen"
"Open Notepad and type 'Hello, CUE!'"
"Show me all open windows"
Current Features
MCP Tools (12)
Screenshot & Screen
| Tool | Description | Parameters |
|---|---|---|
cue_screenshot |
Capture full screen or a region as JPEG | region_x, region_y, region_width, region_height (all optional) |
cue_screen_size |
Get screen resolution | — |
cue_cursor_position |
Get current cursor coordinates | — |
Mouse
| Tool | Description | Parameters |
|---|---|---|
cue_click |
Click at coordinates | x, y, button (left/right/middle), clicks (1-3) |
cue_scroll |
Scroll at position | x, y, clicks (positive=up, negative=down) |
cue_move |
Move cursor | x, y |
cue_drag |
Drag from point A to B | start_x, start_y, end_x, end_y, button, duration |
Keyboard
| Tool | Description | Parameters |
|---|---|---|
cue_type |
Type text (auto clipboard fallback for non-ASCII like Korean/CJK) | text |
cue_key |
Press key or combo | key (e.g. "enter", "ctrl+c", "alt+tab") |
Window Management
| Tool | Description | Parameters |
|---|---|---|
cue_list_windows |
List all visible windows with geometry | — |
cue_focus_window |
Focus a window by partial title match | title |
cue_window_info |
Get active window info | — |
Safety Features
| Feature | Description | Default |
|---|---|---|
| Action limit | Max actions per session before requiring reset | 100 |
| App blocklist | Prevents interaction with sensitive apps | Registry Editor, Windows Security |
| Key blocklist | Blocks dangerous key combos | win+r, ctrl+alt+del |
| Audit log | Every action logged to JSONL file | cue_audit.jsonl |
| FAILSAFE | Move mouse to (0, 0) to abort immediately | Enabled |
| Action delay | Pause between actions for safety | 50ms |
Safety Policy
All safety settings are configurable in config/default.yaml:
safety:
max_actions_per_session: 100
action_delay: 0.05
failsafe: true
allowed_apps: []
blocked_apps:
- "Windows Security"
- "Registry Editor"
- "Task Manager"
blocked_keys:
- "win+r"
- "alt+f4"
- "ctrl+alt+del"
Manual Registration
If you prefer to configure manually instead of using register.py:
Claude Desktop — edit %APPDATA%/Claude/claude_desktop_config.json:
{
"mcpServers": {
"cue": {
"command": "python",
"args": ["-m", "cue"]
}
}
}
Claude Code — edit ~/.claude/settings.json:
{
"mcpServers": {
"cue": {
"command": "python",
"args": ["-m", "cue"]
}
}
}
Project Structure
computer-use-engine/
├── cue/
│ ├── __init__.py # Package version
│ ├── __main__.py # python -m cue entry point
│ ├── server.py # FastMCP server initialization
│ ├── tools/
│ │ ├── screenshot.py # Screen capture tools (3)
│ │ ├── mouse.py # Mouse control tools (4)
│ │ ├── keyboard.py # Keyboard input tools (2)
│ │ └── window.py # Window management tools (3)
│ ├── safety/
│ │ ├── guardrails.py # Action limits, app/key blocking
│ │ └── logger.py # JSONL audit logger
│ ├── core/ # Policy engine, risk scoring (Phase 1)
│ ├── monitor/ # Real-time dashboard (Phase 2)
│ ├── adapters/ # Agent-agnostic backends (Phase 4)
│ └── utils/
│ ├── screen.py # DPI awareness, image processing
│ └── keymap.py # xdotool → pyautogui key mapping
├── config/
│ └── default.yaml # Safety configuration
├── scripts/
│ └── register.py # Auto-registration for Claude
├── tests/ # Unit tests
├── pyproject.toml
├── LICENSE # Apache 2.0
└── README.md
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run the server directly (stdio mode)
python -m cue
Roadmap
| Phase | Focus | Status |
|---|---|---|
| MVP | MCP server, 12 tools, basic guardrails | Done |
| Phase 1 | Policy engine, risk classification, session management | Next |
| Phase 2 | Real-time monitoring dashboard, event streaming | Planned |
| Phase 3 | Human-in-the-loop approval workflows | Planned |
| Phase 4 | Agent-agnostic adapters (Claude, GPT, Agent-S) | Planned |
| Phase 5 | Compliance reports (EU AI Act, SOC 2) | Planned |
Requirements
- Python 3.11+
- Windows 10/11
- Claude Desktop or Claude Code with MCP support
Contributing
Contributions are welcome! Please see LICENSE for details.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。