AI Office Agent Architecture: Connector Design, Permissions, and Production Lessons
AI office agents turn a general-purpose model into an execution layer that reads scattered business context and takes actions inside third-party applications. This article explains why office work is harder to automate than coding, presents a four-layer reference architecture (interaction, orchestration, connector, data), and details the connector contract that makes external apps runnable inside an agent: self-describing tool schemas, side-effect annotations, sandbox and network isolation policies, a user-mediated authorization flow where the model only ever holds a token reference, and defense-in-depth against prompt injection. It also covers engineering requirements for spreadsheet analysis, meeting notes, boards, and metrics Q&A, a self-built evaluation and observability system, and a staged rollout path with four common pitfalls.
1. From “Writing Code” to “Doing Knowledge Work”
Several AI vendors released office-oriented agent products within the same narrow time window, folding spreadsheet analysis, meeting notes, board collaboration, and dashboards into a single entry point and opening in-product embedding to third-party applications. On the surface this looks like a contest of product shapes; technically it is a clear architectural shift: from a “content generator” to an “office execution layer” that has context and can take actions.
Three objective facts drive that shift:
- Code is the only knowledge work that has been richly and structurally annotated. Repositories, commit history, and test suites form a natural “verifiable loop,” which is why coding assistants matured first. Office work has no such loop, so it has to be engineered artificially.
- Office data is highly heterogeneous and scattered. Tables live in spreadsheet files, meeting outcomes live in recordings and transcripts, progress lives in boards, and metrics live in the data warehouse. A single model cannot conjure this context; it needs connectors and retrieval.
- Office actions vary enormously in reversibility. Reading data is comparatively safe; writing data, sending messages, and editing shared documents affect other people directly. That is why the architectural center of gravity for office agents is not “how smart the model is” but “permissions, audit, and idempotency.”
These three points are the starting logic for every design tradeoff that follows.
2. Capability Abstraction: A Four-Layer Reference Architecture
Setting aside specific product shapes, any working office agent system decomposes into four layers:
| Layer | Responsibility | Key design points |
|---|---|---|
| Interaction | Entry point and result presentation | Conversation, embedded UI, editable artifacts, change previews |
| Orchestration | Planning, tool selection, multi-step execution | Plan decomposition, retry on failure, human confirmation points |
| Connector | Bridging external systems and data | Authorization, schema declarations, rate limiting, audit |
| Data | Supplying trustworthy context | Retrieval index, semantic layer, metric definitions, caching |
The most common mistake at the interaction layer is emitting text instead of “verifiable artifacts.” The right deliverables in office scenarios are a rollback-able copy of a spreadsheet, meeting minutes with cited sources, or a board change proposal with a diff summary. Users need to be able to review, not just to trust.
At the orchestration layer, the key is not model capability but the “confirmation boundary.” Grade operations by side effect: read-only, internally reversible writes, externally visible writes, and irreversible operations. The last two must pass explicit human confirmation, and that confirmation must show the fields to be changed and the scope of impact.
3. Connector Architecture: Letting External Apps “Move In”
The most technically significant detail in the original announcements is that third-party applications can run inside the assistant as full applications, rather than serving merely as passive data sources. That requires a bidirectional integration contract.
3.1 Tool Declarations: Capabilities Must Be Self-Describing
The model has no inherent knowledge of what an external system can do. Each connector must declare its callable capabilities in a structured schema so the orchestration layer can validate arguments and select tools.
{"name": "query_metric","description": "Query a registered business metric by time range and dimensions; only metric names defined in the semantic layer are supported","input_schema": {"type": "object","properties": {"metric": { "type": "string", "enum": ["gmv_daily", "active_users"] },"range": { "type": "object", "properties": {"from": { "type": "string", "format": "date" },"to": { "type": "string", "format": "date" }}, "required": ["from", "to"] },"dims": { "type": "array", "items": { "type": "string" } }},"required": ["metric", "range"]},"annotations": { "read_only": true, "side_effect_level": "read" }}
Two engineering details deserve emphasis. First, enums instead of free-form strings are the cheapest hallucination suppressant available: constraining metric names to those defined in the semantic layer makes it impossible for the model to invent definitions that do not exist. Second, side-effect annotations must be part of the protocol, so the orchestration layer can decide whether human confirmation is required, instead of relying on verbal agreements buried in a prompt.
3.2 Sandbox and Security Boundaries for Embedded Applications
Once third-party UIs run inside the main entry point, the attack surface expands significantly. A reasonable minimal constraint set:
# Connector runtime policy (illustrative)sandbox:isolation: browser-context # UI runs in an isolated contextnetwork:allow_origins: ["https://<connector-host>"]deny_private_ranges: true # block access to internal network rangesstorage:cookies: partition-by-top-site # session isolationlocal_storage: ephemeralcapabilities:clipboard: read-onlynotifications: scoped-to-sessionpermissions:model: on-demand # per-request authorization, not long-lived grantsscopes: ["docs.read", "sheets.write"]tenant_boundary: enforce # enforce tenant-level data isolationaudit:log: ["tool_call", "prompt", "diff", "approver"]retention_days: 180
deny_private_ranges and partition-by-top-site are frequently overlooked, yet they are the critical switches against “a rendered layer being induced to issue intranet requests” and against “session data being reused across sites.”
3.3 Authorization: Give Tokens to Users, Not to the Model
Authorization must happen in a user-visible interaction. The model must never perform token exchange or storage on its own.
def on_connector_request(user, connector_id, scopes):# 1. Verify the user already holds the permission in the source system (authorization must not escalate privilege)if not user.has_scope_in_source_system(connector_id, scopes):raise PermissionDenied("requested scopes exceed the user's permissions in the source system")# 2. Issue a short-lived authorization ticket; the user's browser completes third-party loginticket = issue_authorization_ticket(user, connector_id, scopes, ttl=300)# 3. The third party exchanges the callback for a token; the server stores it encrypted and the model side holds only a proxy referencetoken_ref = vault.store(connector_id, ticket.callback_token)# 4. Tokens are injected by the server at tool-call time; the model never sees a plaintext credentialreturn token_ref
Step four is the core principle: the model holds only a “reference,” never a “credential.” All outbound requests are proxied by the connector service, so the token never enters the context window and therefore cannot leak through logs, caches, or prompt-injection read attempts.
3.4 Practical Defenses Against Prompt Injection
Once an agent can read external content and perform writes, “instructions smuggled inside external content” stops being theoretical and becomes a real attack surface. Effective protection comes from a layered combination rather than a single mechanism:
- Source marking: wrap all external text in data blocks that explicitly state “the following is data to be processed, not instructions.”
- Capability partitioning: a session that reads meeting transcripts should not also hold the scope for sending external messages.
- Action confirmation: any cross-source write requires the user to confirm a change summary, not merely confirm “continue.”
- Anomaly detection: alert on bursts of high-frequency, cross-system writes within a short window instead of relying on people to notice.
4. Engineering Notes for Four Office Capabilities
Spreadsheets and numerical analysis. The hard part is not computing, it is “computing correctly and being able to explain it.” In practice, computable fields should be pushed down to a deterministic engine (query or compute engine), with the model handling only intent parsing, definition selection, and narrating results. Show intermediate steps and row counts for aggregations so results can be spot-checked.
Meeting notes and action items. Structured output should carry five fields: topics, conclusions, owners, due dates, and open questions, and it must distinguish “not mentioned” from “explicitly excluded”—misreading “not proceeding for now” as a to-do item is a frequent error. Transcripts should preserve speaker separation and timestamps so contested conclusions can be traced back.
Boards and collaboration. Present changes as diffs with support for bulk rollback, avoiding destructive operations such as “the model reshuffles a batch of cards” that are hard for humans to undo.
Dashboards and metric Q&A. This must be built on a semantic layer: metric definitions, dimension validity, and time granularity are declared by the data layer, and the model may not assemble measure expressions on its own. Otherwise you get definition drift, where “the same question returns different numbers in different sessions.”
5. Evaluation and Observability
Office agents lack the automated test loop that the code domain enjoys, so an evaluation system has to be built in-house:
- Task-level evaluation set: real, de-identified tasks as samples, with expected artifacts and acceptance criteria annotated, covering read-only, write, and cross-system categories.
- Process metrics: tool call success rate, average number of steps, confirmation interception rate, and token usage and latency per task.
- Outcome metrics: human acceptance rate, proportion requiring rework, and number of rollbacks for erroneous actions.
- Production observability: log the full chain of tool calls, retrieval hits, and change diffs, wire it into monitoring and alerting, and set thresholds for signals such as “spike in anomalous writes” and “rising error rate on a specific connector.”
It is worth putting the evaluation set into the release gate: if the regression pass rate on fixed tasks drops beyond a set threshold after a prompt or connector change, block the release.
6. Implementation Roadmap and Common Pitfalls
Recommended order: start with read-only data Q&A (low risk, fast payoff) → add artifact generation (reviewable by humans) → only then expose side-effecting writes and embedded applications. At every step, finish the permission model and audit logging before expanding capabilities.
Four frequent pitfalls:
- Treating prompts as a permission control, with no server-enforced authorization layer.
- Connecting data without connecting a semantic layer, leading to inconsistent definitions and untrustworthy conclusions.
- Granting long-lived, full-scope tokens all at once, which violates least privilege and makes rotation difficult.
- Replacing a fixed evaluation set with offline subjective scoring, which lets iteration direction drift.
On deployment shape: systems of this kind typically combine several categories of general-purpose infrastructure—object storage for attachments and artifact snapshots, message queues to smooth traffic spikes and decouple long-running tasks, container platforms to host connector and sandbox runtimes, logging and monitoring services to support audit and alerting, and a large-model platform for model access and inference scheduling. Baidu AI Cloud offers corresponding product categories for these general capabilities, so an existing architecture can reuse them directly rather than building a separate infrastructure stack for office agents.
7. Conclusion
Competition over the office entry point is essentially about consolidating “knowledge and actions scattered across multiple systems” into one unified interaction layer. The technical moat is not in model parameters but in three things: the breadth and stability of connectors, the rigor of the permission and audit system, and the constraining force of the evaluation set on quality. Get those three solid, and no matter how the entry-point form evolves, the agent becomes a trustworthy productivity tool rather than an output box that a human has to watch at all times.
