Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ MICROSOFT_GRAPH_SCOPES=
# Tools are registered, but side effects remain disabled until explicitly enabled.
MICROSOFT_ENABLED_TOOL_GROUPS=misc,auth,meta,mail,files,calendar,notes,tasks,contacts,user,chat,teams,sites,search,groups,communications,documents,power_platform,windows,intune
MICROSOFT_ALLOW_WRITES=false
MICROSOFT_ALLOW_DESTRUCTIVE=false

# Required only for graph projection/ingestion. Resolve from AgentConfig or a
# secret store; use at least 32 bytes and never reuse an identity credential.
Expand Down
6 changes: 4 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ asynchronous tool execution. Core libraries: `scion-sdk`, `fastmcp`,
tokens in memory and must not enable plaintext persistence.
- Each tool is authorized by its own name; unknown verbs are treated as writes and
fail closed. No tool routes an `action` argument.
- Writes require `MICROSOFT_ALLOW_WRITES`; destructive actions also require
`MICROSOFT_ALLOW_DESTRUCTIVE`.
- Writes require `MICROSOFT_ALLOW_WRITES`; destructive actions also need a live
confirmation (the gateway's approval or the `confirm` argument); there is no
connector destructive setting (the operator's one setting is
`SCION_ALLOW_DESTRUCTIVE`).
- Connector materialization remains quarantined until tenant, ACL, provenance,
schema, and privacy policy are checked.
- Tests must mock all provider and network interactions.
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ tokens remain in memory and are not written to plaintext files.
| `MICROSOFT_GRAPH_SCOPES` | — | |
| `MICROSOFT_ENABLED_TOOL_GROUPS` | `misc,auth,meta,mail,files,calendar,notes,tasks,contacts,user,chat,teams,sites,search,groups,communications,documents,power_platform,windows,intune` | Tools are registered, but side effects remain disabled until explicitly enabled. |
| `MICROSOFT_ALLOW_WRITES` | `false` | |
| `MICROSOFT_ALLOW_DESTRUCTIVE` | `false` | |
| `MICROSOFT_INGESTION_PSEUDONYMIZATION_KEY_REF` | — | Required only for graph projection/ingestion. Resolve from AgentConfig or a secret store; use at least 32 bytes and never reuse an identity credential. |
| `MICROSOFT_INTEGRATIONS_CONFIG_PATH` | — | Complex Power Platform, Intune, and Windows companion allowlists. |
| `MICROSOFT_DOCUMENT_ARTIFACT_ROOT` | — | |
Expand Down Expand Up @@ -264,13 +263,13 @@ and MCP caller identity are separate boundaries and both must be configured.
| `microsoft_tasks` | `TASKSTOOL` | Manage microsoft tasks operations. |
| `microsoft_teams` | `TEAMSTOOL` | Manage microsoft teams operations. |
| `microsoft_user` | `USERTOOL` | Manage microsoft user operations. |
| `reboot_intune_device` | `INTUNETOOL` | Immediately reboot an allowlisted Intune device after destructive action acknowledgement and time-bound confirmation. |
| `reboot_intune_device` | `INTUNETOOL` | Immediately reboot an allowlisted Intune device after time-bound confirmation. |
| `remote_lock_intune_device` | `INTUNETOOL` | Remotely lock an allowlisted Intune device after time-bound confirmation bound to that device and action. |
| `replace_word_placeholders_in_office` | `DOCUMENTSTOOL` | Replace a literal placeholder throughout a paired, open Word document. |
| `run_power_automate_desktop_flow` | `POWER_PLATFORMTOOL` | Run one allowlisted Power Automate desktop flow using its fixed Dataverse connection or connection reference. |
| `run_power_automate_flow` | `POWER_PLATFORMTOOL` | Invoke one named, allowlisted, OAuth-protected Power Automate HTTP trigger. The caller cannot supply a trigger URL. |
| `scan_intune_device_with_defender` | `INTUNETOOL` | Request a quick or full Microsoft Defender scan on an allowlisted Intune device with time-bound confirmation. |
| `shut_down_intune_device` | `INTUNETOOL` | Immediately shut down an allowlisted Intune device after destructive action acknowledgement and time-bound confirmation. |
| `shut_down_intune_device` | `INTUNETOOL` | Immediately shut down an allowlisted Intune device after time-bound confirmation. |
| `submit_windows_action` | `WINDOWS_COMPANIONTOOL` | Submit one typed allowlisted laptop action through the authenticated outbound relay. Arbitrary shell, process, and URL execution are absent. |
| `sync_intune_device` | `INTUNETOOL` | Request an Intune sync for an allowlisted device. Time-bound confirmation evidence bound to the action and device is required. |
| `write_word_selection_in_office` | `DOCUMENTSTOOL` | Write bounded text at the selection in a paired, open Word task pane. |
Expand Down Expand Up @@ -558,8 +557,8 @@ _79 action-routed tool(s) · 268 verbose 1:1 tool(s). Each is enabled unless its

Every routed action passes the fail-closed tool policy. Reads are permitted by
default; unknown actions are treated as writes. Writes require
`MICROSOFT_ALLOW_WRITES=true`, and destructive actions also require
`MICROSOFT_ALLOW_DESTRUCTIVE=true`.
`MICROSOFT_ALLOW_WRITES=true`, and destructive actions also need a live
confirmation (the gateway's approval or the `confirm` argument).

## MCP client configuration

Expand Down Expand Up @@ -607,7 +606,6 @@ default; unknown actions are treated as writes. Writes require
"KGTOOL": "true",
"MAILTOOL": "true",
"METATOOL": "true",
"MICROSOFT_ALLOW_DESTRUCTIVE": "false",
"MICROSOFT_ALLOW_DEVICE_CODE": "false",
"MICROSOFT_ALLOW_WRITES": "false",
"MICROSOFT_AUTHORITY_HOST": "https://login.microsoftonline.com",
Expand Down Expand Up @@ -692,7 +690,6 @@ own runtime secret boundary.
"KGTOOL": "true",
"MAILTOOL": "true",
"METATOOL": "true",
"MICROSOFT_ALLOW_DESTRUCTIVE": "false",
"MICROSOFT_ALLOW_DEVICE_CODE": "false",
"MICROSOFT_ALLOW_WRITES": "false",
"MICROSOFT_AUTHORITY_HOST": "https://login.microsoftonline.com",
Expand Down Expand Up @@ -776,7 +773,6 @@ docker run -i --rm \
-e KGTOOL=true \
-e MAILTOOL=true \
-e METATOOL=true \
-e MICROSOFT_ALLOW_DESTRUCTIVE=false \
-e MICROSOFT_ALLOW_DEVICE_CODE=false \
-e MICROSOFT_ALLOW_WRITES=false \
-e MICROSOFT_AUTHORITY_HOST=https://login.microsoftonline.com \
Expand Down
6 changes: 3 additions & 3 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ server is currently allowed to invoke:

```text
MICROSOFT_ALLOW_WRITES=false
MICROSOFT_ALLOW_DESTRUCTIVE=false
```

Reads work with both flags disabled. Sends, creates, edits, uploads, flow runs,
Reads work with writes disabled. Sends, creates, edits, uploads, flow runs,
and remote actions require writes. Deletes, wipes, retirements, immediate
reboots, shutdowns, and other destructive tools require both flags. Intune and
reboots, shutdowns, and other destructive tools require writes and also a live
confirmation (the gateway's approval or the `confirm` argument). Intune and
Windows companion actions also enforce per-device/action allowlists and
time-bound confirmation evidence inside their service layer.

Expand Down
3 changes: 2 additions & 1 deletion docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ protected.
Intune configuration requires at least one managed-device UUID and an explicit
action allowlist. Every mutation requires evidence bound to the device, action,
correlation ID, idempotency key, approver, reason, and a short expiration. Reboot
and shutdown also require destructive acknowledgement.
and shutdown also need a live confirmation (the gateway's approval or the
`confirm` argument).

The service uses only Microsoft Graph v1.0. `rotateBitLockerKeys` is visible in
the capability report as unsupported because Microsoft currently documents it
Expand Down
4 changes: 2 additions & 2 deletions docs/office-addin.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ URLs, or an open-ended action name.

1. Start the MCP server over HTTPS and set
`MICROSOFT_OFFICE_ADDIN_ORIGINS` to the task pane's exact HTTPS origin.
2. Enable `documents` and `MICROSOFT_ALLOW_WRITES`. Enable
`MICROSOFT_ALLOW_DESTRUCTIVE` only if the agent may delete slides.
2. Enable `documents` and `MICROSOFT_ALLOW_WRITES`. Deleting a slide also needs
a live confirmation (the gateway's approval or the `confirm` argument).
3. Ask the agent to call `create_office_pairing` with `Word` or `PowerPoint`
and a recognizable window label.
4. Paste the returned one-time secret into **Agent pairing** in that intended
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The installed provider families cover:

Every routed action crosses the fail-closed Microsoft tool policy. Read actions are
available by default. Unknown actions are classified as writes. Non-destructive
writes require `MICROSOFT_ALLOW_WRITES=true`; destructive actions also
require `MICROSOFT_ALLOW_DESTRUCTIVE=true`.
writes require `MICROSOFT_ALLOW_WRITES=true`; destructive actions also need a live
confirmation (the gateway's approval or the `confirm` argument).

`list_microsoft_ingestion_projection` returns only keyed opaque node identifiers,
types, and relationships. Arbora validates the signed source manifest and
Expand Down
1 change: 0 additions & 1 deletion mcp_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"KGTOOL": "true",
"MAILTOOL": "true",
"METATOOL": "true",
"MICROSOFT_ALLOW_DESTRUCTIVE": "false",
"MICROSOFT_ALLOW_DEVICE_CODE": "false",
"MICROSOFT_ALLOW_WRITES": "false",
"MICROSOFT_AUTHORITY_HOST": "https://login.microsoftonline.com",
Expand Down
6 changes: 6 additions & 0 deletions microsoft_agent/api/api_client_admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Any

from scion_sdk.mcp.destructive import destructive_operation

from microsoft_agent.api._graph_models import (
graph_model_from_dict,
)
Expand Down Expand Up @@ -137,6 +139,7 @@ async def get_organization(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def update_organization(
self, org_id: str, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -555,6 +558,7 @@ async def get_conditional_access_policy(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def create_conditional_access_policy(
self, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -582,6 +586,7 @@ async def create_conditional_access_policy(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def update_conditional_access_policy(
self, policy_id: str, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -919,6 +924,7 @@ async def get_role_assignment(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def create_role_assignment(
self, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down
2 changes: 2 additions & 0 deletions microsoft_agent/api/api_client_directory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any

from msgraph.generated.users.users_request_builder import UsersRequestBuilder
from scion_sdk.mcp.destructive import destructive_operation

from microsoft_agent.api._graph_models import (
graph_model_from_dict,
Expand Down Expand Up @@ -639,6 +640,7 @@ async def get_risky_user(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def dismiss_risky_user(
self, user_id: str, params: dict | None = None
) -> dict[str, Any]:
Expand Down
3 changes: 3 additions & 0 deletions microsoft_agent/api/api_client_drive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Any

from scion_sdk.mcp.destructive import destructive_operation

from microsoft_agent.api._graph_models import (
comma_separated_values,
graph_model_from_dict,
Expand Down Expand Up @@ -581,6 +583,7 @@ async def get_admin_sharepoint(self, params: dict | None = None) -> dict[str, An
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def update_admin_sharepoint(
self, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down
7 changes: 7 additions & 0 deletions microsoft_agent/api/api_client_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
if TYPE_CHECKING:
from microsoft_agent.power_platform import AsyncHttpTransport

from scion_sdk.mcp.destructive import destructive_operation

from microsoft_agent.api._graph_models import (
decode_graph_base64,
graph_model_from_dict,
Expand Down Expand Up @@ -482,6 +484,7 @@ async def get_application(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def create_application(
self, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -553,6 +556,7 @@ async def delete_application(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def add_application_password(
self, app_id: str, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -657,6 +661,7 @@ async def get_service_principal(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def create_service_principal(
self, data: dict[str, Any], params: dict | None = None
) -> dict[str, Any]:
Expand Down Expand Up @@ -1069,6 +1074,7 @@ async def list_device_configurations(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def wipe_managed_device(
self, device_id: str, params: dict | None = None
) -> dict[str, Any]:
Expand All @@ -1094,6 +1100,7 @@ async def wipe_managed_device(
print(f"Operation failed: {type(e).__name__}")
return {"error": "Operation failed"}

@destructive_operation
async def retire_managed_device(
self, device_id: str, params: dict | None = None
) -> dict[str, Any]:
Expand Down
1 change: 0 additions & 1 deletion microsoft_agent/config_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def configuration_report() -> dict[str, Any]:
},
"policy": {
"writes_enabled": settings.allow_write_tools,
"destructive_enabled": settings.allow_destructive_tools,
"enabled_tool_groups": list(settings.enabled_tool_groups),
},
"documents": get_document_capabilities().model_dump(mode="json"),
Expand Down
Loading
Loading