Skip to content

Add a policy-gated Google Docs agent for the end-to-end demo - #16

Merged
quanghexa94 merged 1 commit into
mainfrom
feat/gdocs-agent
Jul 14, 2026
Merged

Add a policy-gated Google Docs agent for the end-to-end demo#16
quanghexa94 merged 1 commit into
mainfrom
feat/gdocs-agent

Conversation

@quanghexa94

@quanghexa94 quanghexa94 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This is the hexkit half of a one-click, end to end demo of hexgate.

The demo puts three surfaces together:

  • marimo is the narrative. It walks through the agent, its MCP tools, and the policy.
  • hexkit is the user-facing interface where you actually chat with the agent.
  • hexgate is where you review and edit the policies.

This PR adds the hexkit surface: a new backend at demo/gdocs-agent/ that serves one agent over the HexKit contract. The agent connects to a fake Google Docs MCP server and pulls its policy from the hexgate platform, so anything you change in the dashboard applies on the next message here. Your hexkit role (analyst, editor, admin) decides what the agent may do, and a blocked tool call shows up in the chat.

What's in it:

  • demo/gdocs-agent/: the backend (contract endpoints, a long-lived MCP connection, platform policy binding, and an in-memory key handoff for BYOK)
  • demo-users.yaml: analyst / editor / admin logins, password hexademo

Needs the companion PR in hexgate (HexamindOrganisation/hexgate#81) for the notebook, the policy, and the platform seeding. Both have to land for the demo to run.

…exKit contract

A new backend (demo/gdocs-agent/) serving one hexgate agent over the five
contract endpoints, for the gates demo. It connects to a fake Google-Docs MCP
server (its tools land under mcp-gdocs-*), and binds its policy from the hexgate
platform (create_agent(name="docs_agent", bind_policy=True)) so the dashboard is
the single source of truth and edits hot-reload. The caller's HexKit role
(analyst/editor/admin) drives allow/deny; a blocked call streams as a hexgate
error event that HexgateTranslator renders in the tool-calls widget.

- app.py: 5 contract endpoints + an MCP-toolset lifespan (keeps the gdocs stdio
  connection open process-wide) + POST /byok (in-memory OpenAI key handoff).
- agent.py: platform-bound agent build (off the event loop) + role scoping + BYOK.
- gdocs_mcp_server.py, ui/docs.yaml, __main__.py (serves on :8880).
- demo-users.yaml: analyst/editor/admin users matching the policy vocabulary.
@quanghexa94
quanghexa94 merged commit 2e247c2 into main Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant