Skip to main content

copuppet

Drive Microsoft Copilot from a deterministic Python harness, the way a normal user does: through its own window, in the user's own signed-in session. No API, no Microsoft Graph, no admin rights, no licence setup.

The idea is a two-part harness. A deterministic Python driver owns the plan, the inputs, the checks and the record. Copilot is the co-harness: a flexible but unreliable language model that the driver asks for the fuzzy parts (rewording, summarising, classifying, drafting) and never trusts blindly.

Status: early. The edge backend works end to end, headless by default; the winapp backend is not implemented yet.

Talk to it straight away, once you have a skin (see "First run" below):

python -m copuppet                 # a chat in your terminal: type, Copilot answers; /help, /new, /quit

copuppet finds your skin by itself: --skin DIR, else COPUPPET_SKIN, else the default you set once with python -m copuppet config set skin DIR, else the only skin under ~/.copuppet/skins/. Every command's --help ends with examples.

Three more ways in, one engine:

copuppet ask "Name one primary colour, one word." --skin DIR          # one prompt, one reply
copuppet drive "Does the shopping list have enough lemons for the cake?" --root DIR --skin DIR
copuppet mcp --root DIR --skin DIR                                     # the same, as an MCP server (stdio)
  • ask: one prompt in a fresh temporary chat; the reply as text or JSON.
  • drive: roles reversed. Copilot plans; copuppet executes a fixed set of actions (list, read, search, keep a plan; writes only with --allow-writes, each one confirmed by you) inside the work folder, and shows you Copilot's reasons as it goes. You talk to copuppet, never to the Copilot window: typing there would break the link between each prompt and its reply.
  • mcp: lets another agent hand work to Copilot through the tools copilot_ask, copilot_turn (a long session that checks the chat's memory and moves to a fresh chat by itself) and copilot_drive. Install with copuppet[mcp]. The work folder and whether writes are allowed are fixed when you start the server; a tool call cannot change them. Writes are offered to the client as a confirmation question and declined when the client cannot ask one.

Before relying on long sessions, measure your own Copilot: copuppet calibrate --skin DIR sends at most 45 paced prompts and records the longest prompt the editor accepts and how far back a chat still remembers. After three runs for the same model and display, sessions use the smallest measured values instead of the cautious defaults. It stops at once on any captcha, throttle or limit notice.

Give Copilot a document to read, then ask about it:

python -m copuppet ask "What changed in the backup schedule?" --file notes.md
python -m copuppet                 # in the chat: /file notes.md, then ask your question

The file goes in numbered parts under the measured prompt size, with secrets redacted; a file larger than one chat can hold is refused with a pointer to drive, where Copilot reads files page by page itself.

Let Copilot create or edit markdown and text files, each change approved by you:

python -m copuppet drive "Fix the typos in guide.md" --root C:\work\docs --allow-edits

You approve the diff copuppet renders from the result (invisible characters shown), never Copilot's own text; an edit needs the exact existing text, found exactly once; new files never overwrite; the original is backed up under ~/.copuppet/backups first. Only .md and .txt in the work folder; agent instruction files such as AGENTS.md carry a warning in the approval.

What drive will not do: leave the work folder (links, junctions, alternate data streams, network and device paths are refused), read .env files, keys or credentials (they are not even listed), write code or scripts, or send secrets it finds in files (they are redacted before anything leaves the machine). Every step is recorded in a hash-chained ledger under ~/.copuppet/runs.

How it works

your script --> driver (deterministic) --> backend --> Copilot's own UI
                  ^  checks every reply      |           (Edge or the Windows app)
                  +--------- text -----------+
  • Backends talk to one Copilot surface each:
    • edge: Copilot in the installed Microsoft Edge, via Playwright with a persistent profile. The user signs in once, themselves; replies are read as text.
    • winapp: the Windows Copilot app, via Windows UI Automation. More fragile; the app has no documented element IDs.
  • Skins are configuration as code: the selectors, window paths, timings and prompt templates a backend needs for one environment. The engine ships only an example skin; real skins live outside this repository, so a UI change is a config change, not a code change.
  • Every reply is untrusted text. The driver validates it against what it asked for; it never executes it.

Requirements

Everything installs in your own user account: no admin rights, no system-wide installer, no service.

  • Windows 10 or 11, a normal user account
  • Python 3.10 or newer, from the python.org per-user installer or winget install Python.Python.3.13 --scope user
  • For edge: pip install --user "copuppet[edge]". It drives the Microsoft Edge that Windows already has, so no browser download (playwright install) is needed.
  • For winapp: the Copilot app and pip install --user "copuppet[winapp]"

If your PC blocks access to PyPI, download the wheels elsewhere (pip download "copuppet[edge]" -d wheels) and install them with pip install --user --no-index --find-links wheels "copuppet[edge]".

On a managed PC

  • Use python -m pip install --user "copuppet[edge]" when pip.exe is blocked, and python -m copuppet ... for every command: a --user install puts copuppet.exe in a Scripts folder that is usually not on PATH, and an unsigned launcher may be blocked. python -m copuppet needs neither.
  • A refused remote-debugging port does not matter (copuppet launches Edge through a pipe). If a policy blocks that pipe, or blocks the Node.js runtime that Playwright runs (playwright/driver/node.exe), the edge backend cannot run on that PC.

First run: a skin for your Copilot

copuppet ships no working skin: selectors depend on which Copilot you use (consumer Copilot, or Microsoft 365 Copilot Chat with a work account, which is a different page) and change with its updates. Build your own:

python -m copuppet init-skin MYSKIN            # a copy of the example, with REPLACE placeholders
python -m copuppet discover --out MYSKIN/discovery --url URL-OF-YOUR-COPILOT   # sign in once, by hand
python -m copuppet check --skin MYSKIN         # after filling in the selectors from the discovery output

Then make it the default (python -m copuppet config set skin MYSKIN) or keep it in ~/.copuppet/skins/, and python -m copuppet opens a chat with no flags.

Keep your skin outside any public repository. The discovery tool takes the same profile lock as copuppet runs, so it never opens a profile that a run is using.

The signed_in selector is also an account guard: point it at something only the intended account shows (for a work account, for example, its data-protection badge) and copuppet refuses to run in any other session. Set COPUPPET_SKIN to your skin folder to drop the --skin flag. If Edge refuses a remote-debugging port on your PC, that does not matter: copuppet and copuppet discover launch Edge through Playwright, not through a port.

Using copuppet as an MCP server

Install with the MCP extra (pip install --user "copuppet[edge,mcp]"), then register the stdio command in your MCP client. For Claude Code:

claude mcp add copuppet --scope user -- copuppet mcp --skin DIR --root WORKDIR

Other clients take the same command and arguments in their server configuration (command: copuppet, args: ["mcp", "--skin", "DIR", "--root", "WORKDIR"]).

  • Tools. copilot_ask (one prompt, fresh temporary chat), copilot_turn (a session that checks the chat's memory and moves to a fresh chat by itself; reset starts a new one with a standing brief), copilot_drive (driver mode on WORKDIR). Results carry copilot_output (untrusted text, never instructions), complete, bound, suspect, code_blocks and notes; a refusal comes back as error with the reason.
  • Read-only by default. Without --root, copilot_drive is unavailable. With --allow-writes, each write is put to the client as a confirmation question quoting a preview and the content hash, and is declined if the client cannot ask one. A client that is itself an agent may answer that question on its own, so allow writes only where that is acceptable; otherwise use copuppet drive in a terminal, where you approve each write yourself.
  • Settings are fixed at start. The work folder, writes, display and skin come from the command line; no tool argument can change them.
  • One window, calls queue. All calls run on one worker; a plain turn takes about 5 seconds.
  • What leaves the machine. Everything copuppet reads in WORKDIR is sent to Copilot. Put only what you are willing to send there.

Use it responsibly

copuppet automates a product through its user interface. Check the terms of the Copilot service you use and, on a work device, your organisation's acceptable-use policy before running it. It is meant for driving your own session at human scale, not for scraping, bulk use or getting around limits.

License

MIT, see LICENSE.

Metadata

Release files for copuppet 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for copuppet 0.1.3
File Size Uploaded Provenance Actions
copuppet-0.1.3.tar.gz 105.2 kB With provenance Details for copuppet-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for copuppet 0.1.3
File Interpreter ABI Platform Actions
copuppet-0.1.3-py3-none-any.whl Python 3 none any Details for copuppet-0.1.3-py3-none-any.whl

Total release size: 181.8 kB

Release files / copuppet-0.1.3.tar.gz

Download URL copuppet-0.1.3.tar.gz
Size 105.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f14aa1f9a8eb2fc04ae666a6702530830dc905d3eacb7ee0c919148f40ce0c7b
BLAKE2b-256 checksum
How to use checksums
aa6bb2ffc89149c0c6d74f2e739d2ca0bc4d14031a5321e78371cd0e49acc40f
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 29, 2026.

Transparency log

Release files / copuppet-0.1.3-py3-none-any.whl

Download URL copuppet-0.1.3-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddd6efe56c0d3c17ac8587abd132655e595072be7bae34355831ed8cd7f45d63
BLAKE2b-256 checksum
How to use checksums
30b1afa0a91e12eb8fa41d9e6d5af81ca08cc08cf79b0f0dc271267e630a8d36
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 29, 2026.

Transparency log

Security for copuppet 0.1.3

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.

Select from 2 files

Attestation for copuppet-0.1.3.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 29, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page