Skip to content

feat(audit): record integration tool calls made through the v2 API and Sim MCP - #10680

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/mcp-tool-call-audit
Dec 2, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
feat/mcp-tool-call-audit

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New audit action tool.executed (resource type tool). It records every integration tool run directly through POST /api/v2/tools/{toolId}/execute, which also covers Sim's MCP server (executeTool) as used from Claude Code or Cursor. Before this, a Gmail send or Slack post made that way left no audit entry; only a merged credential.accessed row for the token, with no tool name.
  • Recorded from the use case's projectAudit. Tools with effect: 'write' are audited, and so are tools with an unknown effect, so anything that may change something outside Sim is covered.
  • A failed call is still recorded with metadata.status: failed. That covers a write the provider rejected, which may have partly applied, and one Sim refused inside the run, such as a denied tool. Error text is not stored, because provider and parser errors can echo the input.
  • Read-only tools are not recorded per call; their credential's credential.accessed trail covers them. This keeps the audit log readable when a coding agent lists or searches in a loop.
  • Calls refused before dispatch (validation, permission, integration not allowed) record nothing.
  • Each entry carries the actor, workspace, tool id and name, status, and credentialId. MCP calls get surface: mcp from the client-info header the MCP dispatcher already sets. Tool inputs, outputs and error messages are never copied into the entry.
  • Docs: audit-log events table and a paragraph describing the entry.

Type of Change

  • New feature

Testing

  • execute-tool.test.ts (38): write audited without copying input; failed write (provider rejection, in-run refusal, input-echoing error) audited as failed without error text; read not audited; pre-dispatch refusal not audited. Each guard was reverted to confirm its test goes red.
  • packages/audit tests, lint, explicit-any, comment-hygiene, boundaries, test-patterns, source-conventions

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Dec 2, 2026 10:54pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/audit/src/types.ts Resolved
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds tool.executed audit entries for direct API and MCP calls to tools not marked read-only.

  • Direct tool runs now leave an audit entry for possible external changes.

Reviews (3) · Last reviewed commit: "fix(audit): keep error text out of tool...." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit d5b292a into staging Dec 2, 2026
87 of 88 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/mcp-tool-call-audit branch December 3, 2026 00:44

This branch was successfully deployed

1 active deployment
Preview — 150f14ba Deployed Dec 2, 2026 by vercel[bot]
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