MobileOPS Managed Agent Python SDK
Server-side Python SDK for the MobileOPS Managed Agent API.
The SDK exposes these surfaces:
client.agentwraps the LangGraph runtime client and exposes the supported Assistant CRUD methods atclient.agent.assistants.client.filesexposes MobileOPS Sandbox Workspace file routes.client.resourcesmanages Context Hub resources, versions, and latest-version files.client.vaultsmanages credential vaults and their write-only credentials.client.sandbox_profilesmanages sandbox profiles (运行环境).client.data.mmodelqueries and updates the semantic model of a data group using the sibling/api/data/groups/{id}/mmodelAPI.
Assistant create and update retain LangGraph's ordinary arguments, while
persisted configuration is exposed through product fields. Pass
response_schema to persist a Draft 2020-12 object schema, read the Run's
validated result from final state structured_response, and pass
response_schema=None on update to clear it.
Note: the Agent Server freezes the Assistant config into each Thread at
creation, and that frozen copy takes precedence over the Assistant's current
config on later Runs. Setting, changing, or clearing response_schema
therefore only affects Runs started on new Threads; existing Threads keep
the schema captured at their creation.
import os
from mobileops_managed_agent import MobileOpsManagedAgentClient
client = MobileOpsManagedAgentClient(api_url=api_url, api_key=api_key)
thread = await client.agent.threads.create()
await client.agent.runs.create(thread["thread_id"], assistant_id, input=input)
skill = await client.resources.create("skills", zip_bytes) # slug inferred
profile = await client.sandbox_profiles.create(
name="prod",
spec={"network": {"allow": ["*.example.com"]}},
)
vault = await client.vaults.create(name="prod")
await client.vaults.credentials.create(
vault["id"],
name="GRAFANA_TOKEN",
value=os.environ["GRAFANA_TOKEN"],
allowed_hosts=["grafana.example.com"],
)
assistant = await client.agent.assistants.create(
name="Operations agent",
skills=[{
"ref": skill["ref"], # e.g. incident-response@sha256-…
"target_path": "/workspace/skills", # zip already contains {slug}/
}],
sandbox_profile=profile["id"],
credential_vault=vault["id"],
)
await client.resources.versions.create("skills", skill["slug"], next_zip_bytes)
await client.resources.files.list("skills", skill["slug"])
await client.files.list(thread["thread_id"], "/workspace")
Keep MobileOPS Managed Agent API keys in server-side code only.
Built-in tool presets (0.7.0)
client.agent.assistants.create() defaults to writable built-in permissions when
tool_permissions is omitted. It allows read_file, write_file, edit_file,
execute, task, eval, write_todos, and request_user_input, and disables
the remaining built-ins.
from mobileops_managed_agent import readonly_tool_permissions
assistant = await client.agent.assistants.create(
name="Read-only agent",
tool_permissions=readonly_tool_permissions(),
)
The read-only preset allows ls, read_file, glob, and grep, along with the
same orchestration and interaction tools. It only governs built-ins; configure
MCP permissions separately. Use writable_tool_permissions() for an explicit
writable preset. Both helpers return fresh configurations, without approval
requirements by default.
Explicit permissions replace the preset entirely, including empty and MCP-only policies. Updates that omit permissions preserve the current policy. Existing Assistants and direct HTTP/native LangGraph SDK calls are not migrated.
Semantic models
Use a Key with model:read for queries and model:write for updates. Keep the
existing api_url ending in /api/managed-agent; no extra service URL is needed.
result = await client.data.mmodel.query(
group_id, "knowledge | where id = $id", parameters={"id": "service-notes"}
)
current = result["items"][0] if result["items"] else {"id": "service-notes", "entity_id": "checkout"}
await client.data.mmodel.apply(group_id, [{
"op": "upsert", "kind": "knowledge",
"data": {**current, "content": "Check downstream latency before restarting."},
}], expected_revision=result["revision"])
Queries run on the server; the SDK does not parse SPL. Updates are atomic and
support dry_run=True. MobileOpsDataError.body preserves the complete error
response, including query-position and operation details.
Streaming in 0.4.0
Run streaming defaults to messages-tuple, updates, and custom. Explicit
values subscriptions raise ValueError before network access. Fetch full state
once with client.agent.threads.get_state(thread_id) after the stream ends.
SDK 0.5.0 Data API
Use client.data.endpoints, client.data.datasources, client.data.groups,
client.data.mmodel and client.data.proxy. The old client.model entry and
model-specific error are removed; catch MobileOpsDataError. See the
complete guide in the documentation site Data API chapter
for management, streaming and cancellation examples. No automatic retries or pagination.
SDK 0.6.0 semantic model revisions
Every model query returns an opaque group-level revision. Apply requires expected_revision from the query used to prepare changes (Python: required keyword argument; TS: request field). A successful write returns the new revision; dry-run keeps it unchanged. A 409 model_revision_conflict requires re-reading the relevant records and reconciling changes, not just replacing the revision. There is no automatic fetch/retry. Old SDKs and old sandbox CLIs cannot write after the server upgrade; upgrade clients and create a new sandbox.
Metadata
Release files for mobileops-managed-agent 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mobileops_managed_agent-0.7.1.tar.gz | 29.5 kB | With provenance | Details for mobileops_managed_agent-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mobileops_managed_agent-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for mobileops_managed_agent-0.7.1-py3-none-any.whl |
Total release size: 66.7 kB
Release files / mobileops_managed_agent-0.7.1.tar.gz
| Download URL | mobileops_managed_agent-0.7.1.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e5145d52b128cfe1f049e6e0cac73467f56ee1e4e41375617068ec27b323e97
|
|
BLAKE2b-256 checksum How to use checksums |
bd586909ef8a5df81a6af9f8bc3dbe261b59bc9ca54ba7429f0299052559458a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / mobileops_managed_agent-0.7.1-py3-none-any.whl
| Download URL | mobileops_managed_agent-0.7.1-py3-none-any.whl |
|---|---|
| Size | 37.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53a51acbb23f12f1043209ecd4e80033b333be808d5524e57f54d81d9bb3e683
|
|
BLAKE2b-256 checksum How to use checksums |
a3ee5980a756f8ce2d9eede604984329f87d2ca07f118c6b19ee3733d209eea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for mobileops-managed-agent 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mobileops_managed_agent-0.7.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.