Edit Word Documents Without Word
Most document editing tools assume a human is sitting at a screen. You open a file, make changes, save it, move on. That works for one document at a time.
But what about 200 vendor contracts that need the same clause updated? Or nightly compliance checks on incoming regulatory filings? Or generating personalized proposals for every deal in your pipeline?
You need an agent—not an app.
What Background Agents Do
A background agent is a program that edits Word documents autonomously. No browser. No Word license. No human clicking buttons. You give it a document and instructions, and it executes.
The critical difference from other automation tools: every edit produces real Word track changes. The output isn't a black box. It's a standard .docx file where you can see exactly what the agent changed, accept or reject edits individually, and maintain a complete audit trail.
The Python SDK
Background agents are built with the Docmods Python SDK, which wraps the OpenAI Agents SDK. If you've used that before, this will feel familiar.
from docxagent import DocxAgent
from agents import Runner
agent = DocxAgent(api_key="your-api-key")
# Upload a document
doc_id = agent.upload("contract.docx")
# Run the agent with a natural language prompt
result = Runner.run_sync(agent, f"""
Review document {doc_id}. Flag any clauses with unlimited
liability exposure. Add comments explaining the risk and
propose alternative language as tracked insertions.
""")
# Download the edited document
agent.download(doc_id, "contract_reviewed.docx")
That's a complete, working agent. Upload, instruct, download. The SDK handles authentication, tool routing, and the agent loop internally.
What the Agent Can Do
Background agents have access to the same tools as the interactive editor:
- Read document content, structure, paragraphs, and tables
- Add comments with optional text highlighting
- Insert text with track changes (marked as insertions)
- Propose deletions with track changes (marked as strikethrough)
- Reply to, resolve, or delete comments
- Insert paragraphs at specific locations
- Create documents from scratch with headings, tables, charts, and styling
- Validate OOXML structure to catch corruption before delivery
The agent decides which tools to use based on your instructions. You describe the task; it figures out the execution.
Use Cases for Background Agents
Automated Contract Review
Upload incoming contracts and let the agent flag risky clauses, missing provisions, and deviations from your playbook. The output is a marked-up Word file your lawyers can review in minutes instead of hours.
# Process every contract in a folder
for contract_path in Path("incoming_contracts").glob("*.docx"):
doc_id = agent.upload(str(contract_path))
Runner.run_sync(agent, f"""
Review {doc_id} against our standard terms:
- Flag unlimited liability clauses
- Flag missing IP assignment provisions
- Flag non-standard termination terms
Add comments explaining each issue.
""")
agent.download(doc_id, f"reviewed/{contract_path.name}")
Compliance Document Checks
Regulatory filings, SOPs, and policy documents need regular review. Schedule an agent to run nightly, check documents against current requirements, and flag anything that needs attention.
Report Generation Pipelines
Pull data from your systems, generate formatted Word reports with tables and charts, and deliver them to stakeholders—all without a human touching a document editor.
Document Standardization
When branding changes, legal language updates, or formatting standards evolve, an agent can apply consistent updates across your entire document library.
Deployment Patterns
Serverless Functions
Deploy an agent as an AWS Lambda or Google Cloud Function. Trigger it from an S3 upload event, a webhook, or an API call.
CI/CD Pipelines
Add document generation to your build pipeline. When contract templates change, automatically regenerate all derived documents and validate them.
Scheduled Jobs
Run agents on a cron schedule. Nightly compliance checks, weekly report generation, or monthly document audits.
Event-Driven Processing
Connect to your existing systems via webhooks. When a new contract lands in your CRM, trigger an agent to review it and route the marked-up version to the right team.
Why Not Just Use python-docx?
The popular python-docx library handles document creation well, but it cannot produce track changes. When you modify a document with python-docx, the changes are applied silently—no insertions, no deletions, no markup. The recipient sees a finished document with no way to know what changed.
Docmods operates on the raw OOXML underneath Word documents. It produces proper tracked changes with author attribution, timestamps, and the full revision markup that Word expects. The output is indistinguishable from edits made by a human in Microsoft Word.
Transparent by Default
Every background agent edit is a tracked change. This isn't optional—it's how the system works. You always get:
- Tracked insertions marked with the agent's author name
- Tracked deletions shown as strikethrough
- Comments explaining the reasoning behind substantive changes
- Version history so you can compare any two states of the document
This matters for compliance, for legal defensibility, and for simple quality control. You can always see what the agent did and why.
Get Started
Install the SDK, create an agent, and run it on a document. The pricing page has details on API access—available on Business and Enterprise plans.
pip install docxagent





