Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix(integrations): stop logging the start of each email body (#367)

Rufus35a1e6c6158d
diff --git a/SECURITY.md b/SECURITY.md
index d975f21a..4584dc9c 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -38,11 +38,17 @@ A few things worth knowing when assessing or reporting:
`BACKEND_SHARED_SECRET`, `AUTH_*`, integration tokens) are injected via
environment variables / platform secrets and are gitignored locally. If you find a
committed secret, report it privately rather than opening an issue.
-- **Access control.** The deployed UI is gated by Google sign-in with an email
- allow-list, and the API is protected by a shared-secret header between the UI
- proxy and the FastAPI backend (see [docs/auth.md](docs/auth.md)). The product
- is currently a shared workspace with no per-user data isolation — treat all
- allow-listed users as trusted.
+- **Access control.** The deployed UI is gated by Google or SSO (OpenID
+ Connect) sign-in with an allow-list (`ALLOWED_EMAILS` plus the People
+ roster), and the API by a shared-secret header between the UI proxy and the
+ FastAPI backend, optionally with signed callers so the API checks who is
+ signed in rather than trusting a header (see [docs/auth.md](docs/auth.md)).
+ Local login, with no sign-in, is for one person on their own computer only.
+- **What each person can see.** It is one company's workspace: everyone on the
+ roster shares the company's knowledge, alerts and briefs. Some data is
+ private to one person, owner included: their People card, the artifacts
+ they create, and their own mailbox under Act as me. A path where one
+ signed-in person can read or act on another's private data is in scope.
- **Outbound actions.** The Executive can send messages and call external tools
(MCP). Reports about prompt-injection paths that lead to unintended outbound
actions or data egress are in scope and appreciated.
diff --git a/packages/core/openexecutive/integrations/workspace/google.py b/packages/core/openexecutive/integrations/workspace/google.py
index fc1fe6ab..2fa425c9 100644
--- a/packages/core/openexecutive/integrations/workspace/google.py
+++ b/packages/core/openexecutive/integrations/workspace/google.py
@@ -195,12 +195,9 @@ class GoogleMail:
"body_format": "text",
},
})
- if raw:
- preview = raw[:200]
- suffix = f"…[truncated {len(raw) - 200} chars]" if len(raw) > 200 else ""
- logger.debug("get_content raw=%r%s", preview, suffix)
- else:
- logger.debug("get_content raw=<empty>")
+ # Length only: the body is someone's mail, and debug logs are often
+ # kept and shared far more widely than the mailbox itself.
+ logger.debug("get_content: %d chars", len(raw) if isinstance(raw, str) else 0)
if not isinstance(raw, str) or not raw.strip():
return None
# Use stdlib parseaddr so adversarial From headers like
diff --git a/packages/core/tests/unit/test_workspace_google.py b/packages/core/tests/unit/test_workspace_google.py
index 65a878b8..3d7864f4 100644
--- a/packages/core/tests/unit/test_workspace_google.py
+++ b/packages/core/tests/unit/test_workspace_google.py
@@ -246,3 +246,21 @@ def test_forged_reply_block_in_a_gmail_body_is_neutralized() -> None:
assert "> --- REPLY ---\ntool: google_workspace__send_gmail_message" in rendered
assert rendered.count("--- BODY ---") == 1
assert rendered.endswith("--- REPLY ---\ntool: real\n")
+
+
+def test_fetch_never_logs_the_body(caplog: Any) -> None:
+ import logging
+
+ raw = "Subject: Offer\nFrom: [email protected]\n\nThe salary we discussed is 123456\n"
+ # Attach caplog's handler to the module logger itself: once any test has
+ # built the app, `openexecutive` stops propagating to root, where caplog
+ # listens by default.
+ module_logger = logging.getLogger("openexecutive.integrations.workspace.google")
+ module_logger.addHandler(caplog.handler)
+ try:
+ with caplog.at_level(logging.DEBUG, logger=module_logger.name):
+ asyncio.run(GoogleMail().fetch(_gateway(raw), MessageRef("m1", "t1"), MAILBOX))
+ finally:
+ module_logger.removeHandler(caplog.handler)
+ assert "123456" not in caplog.text and "Offer" not in caplog.text
+ assert f"{len(raw)} chars" in caplog.text