
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@codmir/agent-mobile-sdk
Advanced tools
Device-as-a-tool SDK — let AI agents control mobile apps via Socket.IO
Device-as-a-tool — Let AI agents control mobile apps.
The first SDK that lets an AI agent running on your server reach into a user's phone and perform actions: navigate screens, fill forms, press buttons, read content, trigger calls. The inverse of how mobile apps work today.
npm install @codmir/agent-mobile-sdk
import { MobileAgentBridge, ALL_PRESETS } from "@codmir/agent-mobile-sdk/react-native";
import { io } from "socket.io-client";
import { Alert } from "react-native";
import { router } from "expo-router";
const bridge = new MobileAgentBridge({
serverUrl: "https://your-server.com",
authToken: "user-jwt-token",
projectId: "project-123",
// User sees a prompt before dangerous actions execute
onApprovalRequired: async (request) => {
return new Promise((resolve) => {
Alert.alert(
"AI wants to act",
`${request.description}\n\n${JSON.stringify(request.params)}`,
[
{ text: "Deny", onPress: () => resolve(false) },
{ text: "Allow", onPress: () => resolve(true) },
]
);
});
},
});
// Register action handlers
bridge
.registerAction(ALL_PRESETS[0], async (params) => {
// NAVIGATE
router.push(params.route as string);
return { navigated: true };
})
.registerAction(ALL_PRESETS[1], async (params) => {
// FILL_FIELD — your app state management fills the field
return { filled: true };
})
.registerAction(ALL_PRESETS[3], async () => {
// READ_SCREEN — return current screen state
return {
route: "/project/123/tasks",
fields: [],
buttons: [{ id: "create-task", label: "Create Task", enabled: true }],
};
});
// Connect to workroom
await bridge.connect(io);
import {
createMobileActionTool,
createReadScreenTool,
} from "@codmir/agent-mobile-sdk/server";
// Register as tools in your agent's tool registry
const tools = [
createMobileActionTool(),
createReadScreenTool(),
// ... your other tools
];
// When the agent calls mobile_action, forward to the connected device
socket.emit("mobile:command", {
id: crypto.randomUUID(),
type: "navigate",
params: { route: "/project/123/tasks" },
timestamp: Date.now(),
});
// Listen for results
socket.on("mobile:result", (result) => {
// Feed back to the agent's tool_use response
console.log(result.success, result.data);
});
┌──────────────────┐ Socket.IO ┌──────────────────┐
│ AI Workroom │◄──────────────────►│ Mobile App │
│ │ │ │
│ Agent calls │ mobile:command │ Bridge receives │
│ mobile_action │────────────────────►│ & executes │
│ │ │ │
│ Agent reads │ mobile:result │ Handler returns │
│ tool result │◄────────────────────│ result │
│ │ │ │
│ │ mobile:read_screen │ Screen reader │
│ │────────────────────►│ returns state │
│ │ mobile:screen_state│ │
│ │◄────────────────────│ │
└──────────────────┘ └──────────────────┘
| Action | Danger | Description |
|---|---|---|
navigate | safe | Navigate to a screen |
fill_field | safe | Fill a text input |
press_button | confirm | Press a button (prompts user) |
read_screen | safe | Read current screen state |
scroll | safe | Scroll the view |
show_notification | safe | Show a local notification |
trigger_call | confirm | Join a voice room |
set_status | safe | Update online status |
custom | varies | App-specific actions |
bridge.registerAction(
{
type: "custom",
description: "Create a new task in the current project",
danger: "confirm",
params: {
title: { type: "string", required: true },
priority: { type: "string", enum: ["low", "medium", "high"] },
},
},
async (params) => {
const task = await createTask(params.title, params.priority);
return { taskId: task.id };
}
);
The user says to the AI workroom:
"Create a task called 'Fix login bug' with high priority in the mobile app"
The agent:
mobile_read_screen → sees user is on the project dashboardmobile_action({ action: "navigate", params: { route: "/tasks/new" } })mobile_action({ action: "fill_field", params: { fieldId: "title", value: "Fix login bug" } })mobile_action({ action: "select", params: { fieldId: "priority", value: "high" } })mobile_action({ action: "press_button", params: { buttonId: "create" } }) → user sees approval prompt → approvesApache-2.0
FAQs
Device-as-a-tool SDK — let AI agents control mobile apps via Socket.IO
The npm package @codmir/agent-mobile-sdk receives a total of 3 weekly downloads. As such, @codmir/agent-mobile-sdk popularity was classified as not popular.
We found that @codmir/agent-mobile-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.