Skip to contentSkip to main content
← Back to all posts

How to Give an AI Agent Write Access to Notes Without Losing Control

Safely connect AI agents to editable notes: compare MCP read/write permissions, preview approvals, expected hashes, idempotent retries, and deletion safeguards.

Share by email

An AI assistant that can search your project notes is useful. An assistant that can edit them could save even more time—but a misunderstood instruction might overwrite a decision, append the wrong client's information, or remove material you meant to keep. The difference between helpful automation and expensive cleanup is not a more forceful prompt. It is the write boundary.

This guide explains how to move from read-only MCP access to controlled note changes, what to inspect before approving a mutation, and how to test whether an agent exceeds its authority. The examples use Phasoric's documented MCP interface, but the review pattern applies elsewhere.

Separate three kinds of permission

An agent's ability to ask for an edit is not the same as its authority to perform one. Consider three layers:

  1. Client permission: Does the AI client have read-only credentials or the additional write scope?
  2. Vault permission: Is this particular vault mapping writable for the account and provider connection?
  3. Change approval: Has a person reviewed the exact operation, note, and revision being changed?

An instruction such as "never delete anything" is a preference, not a security boundary. If the backend does not enforce it, an injected instruction could still reach a destructive tool.

For a first connection, grant reading only. Confirm that retrieval respects project boundaries before introducing mutations. If MCP is new to you, see What Is MCP? Connecting AI Assistants to Your Knowledge Base.

What Phasoric's hosted MCP supports

The public developer contract documents OAuth scopes mcp:read and mcp:write. Read access covers authorized search and retrieval. Write scope permits requests for guarded note-change and deletion tools; it does not waive mapping policy, revision checks, idempotency, or approval.

The hosted gateway serves explicitly mapped Phasoric Hosted, Dropbox, Google Drive, and GitHub knowledge locations. A remote provider is not automatically writable because its account is connected. For an external mapping, the owner must enable Allow hosted MCP note changes on that mapping, the provider connection must have write capability, the mapping cannot be pull-only, and device-held encryption cannot prevent server access.

The documented browser WebMCP adapter is a different transport. It can work with an active local workspace; the hosted endpoint cannot secretly read or change local-only notes. Device-encrypted bodies whose keys remain on your device are similarly inaccessible to hosted MCP.

These are documented API capabilities, not a promise that every user plan, mapping, or AI client enables them. Availability depends on account entitlements and the exact connection.

A safe write takes two stages

Suppose an assistant reads an engineering decision and proposes adding a review reminder. Do not ask it to "update the knowledge base" without constraints. Choose a precise target and request a preview.

Stage 1: Inspect. The agent discovers the allowed vault through list_vaults, reads the note if necessary, and calls preview_note_writes with the target path and proposed content. This tool is always a dry run.

Review the proposed change against five questions:

  • Is the selected vault and path correct?
  • Does the edit preserve the original rationale and links?
  • Is the new statement supported by actual evidence?
  • Is this a creation, replacement, append, or deletion as intended?
  • Could the result expose private material to someone else?

Stage 2: Approve and apply. Only after reviewing the exact result should the client call apply_note_writes. Applied writes require an idempotency key so retries do not create a second logical operation. For existing notes, an expected content hash protects against overwriting a version changed since preview.

Phasoric also documents create_or_append_note, which defaults to dry run and requires explicit dryRun: false for an approved mutation. A callable tool is not proof of success: inspect the response and independently read the note back.

Why the expected hash matters

Imagine this sequence: an agent previews a change at 10:00; a colleague edits the note at 10:01; the agent applies its old proposal at 10:02. Without a concurrency check, that proposal might erase the colleague's work.

Phasoric's contract uses expectedHash for existing content. A preview returns a usable beforeRevision hash. Remote reads may include a provider revision, but provider revision and content hash are not interchangeable. Use contentHash or the preview's beforeRevision for the expected hash.

If the hash no longer matches, stop. Reread the note, prepare a fresh preview, and obtain fresh approval. Retrying the stale edit with a different key defeats the protection.

Treat deletion separately

Deletion is not simply a write with empty content. The documented preview_note_deletions and apply_note_deletions tools provide a separate review path. Application specifies a path and expected hash. Check the file name, references from other notes, and recovery options before approving.

Recovery differs by backend. Phasoric Hosted documents transactional writes and recoverable trash. Google Drive deletions go to Drive trash; GitHub changes create commits on the mapped branch. That does not make every provider's rollback behavior identical.

During an agent's first week with write access, prefer creating or appending to a disposable review note. Keep replacements and deletions under explicit, individual approvals.

Make remote changes small and verifiable

A bounded Phasoric Hosted batch can be atomic. Remote providers are different: the public contract limits an applied remote request to one note per idempotency key because provider writes and Phasoric's audit database cannot be committed atomically together.

A prompt such as "reorganize my entire workspace" creates a larger recovery surface than a single reviewed edit. Break migrations into small units, preserve the source, record revisions or commits, and verify each result.

Do not treat a partial response as universal success. Provider timeouts, bounded results, and permissions can leave work incomplete. Report what was confirmed, what failed, and what was not attempted.

A 20-minute permission acceptance test

Use a disposable folder or mapping—not a customer workspace. Create a sample note with a decision, a source link, and an intentionally obsolete earlier decision.

TestExpected result
Read-only client requests a writeRejected at the authorization boundary
Write-enabled client requests a previewShows proposed change; note remains unchanged
Apply attempts to bypass approvalGuardrails reject unapproved operation
Source changes after previewOld expected hash is rejected
Approved operation is retried with the same keyNo second logical edit
Agent targets another vaultMapping and provider permissions prevent access

After each test, read the note independently; do not rely on the assistant saying "nothing changed." Record the observed hash, tool status, and audit reference when available.

Also put a malicious sentence into a disposable source note telling the agent to ignore approvals. It may quote the sentence as data. It must not adopt it as permission to mutate another note.

Decide when writing is appropriate

Research and source inspection usually require retrieval, not mutation. A project-summary workflow may benefit from a draft saved in a review folder. A production runbook or client contract deserves stricter controls.

A practical escalation policy:

  • Level 0: Read-only search and citation; default for new connections.
  • Level 1: Agent proposes a change; reviewer saves it manually.
  • Level 2: Agent previews a write within a bounded location; human approves exact content.
  • Level 3: Repeated tested workflows apply individually approved operations with revision checks, idempotency, and audit review.

These are suggested operating levels, not Phasoric subscription tiers or advertised settings. The correct level depends on enforceable controls and operational risk.

If permissions change, revisit the connection. Phasoric documents reviewing or revoking connected applications under Settings → AI Connections & API → Connected applications. Revoking a client credential differs from changing one mapping's write permission.

What trustworthy AI note editing looks like

Each durable change should be explainable: which source was read, which note was targeted, what the diff contained, who approved it, which version changed, and what readback confirmed.

Start with read-only MCP, prove retrieval boundaries, then graduate one disposable note to preview-and-approval. If that write survives concurrency, retry, and permission tests, you have evidence to expand carefully.

For the wider context model, see AI Agent Memory for ChatGPT, Claude & Codex. Consult the developer MCP contract for current client and provider details.

Frequently asked questions

Can an MCP-connected AI agent change notes without permission?

A client needs a write scope, a writable authorized vault mapping, and the guarded application process. A successful read connection alone does not authorize writes.

How can an AI agent avoid overwriting newer note edits?

Preview the existing note, preserve its content hash, and require that expected hash on application. If the note changes, reread it and obtain new approval.

Does hosted MCP permit edits to local-only or device-encrypted notes?

No. Hosted MCP works with explicitly mapped reachable vaults. Local-only browser state and note bodies encrypted using device-held keys remain outside its reach.