[Feature/Example] Add End-to-End Example Integrating Google SecOps OneMCP with OpenAI Agents API
- Dominant language
- Python
- Stars
- 528
- Forks
- 141
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
**Issue Overview**
This issue proposes building and documenting a reference implementation that connects OpenAI's Agents API to Google SecOps via remote HTTP Model Context Protocol (MCP) endpoints (OneMCP / mcp-security).
OpenAI's Agents API provides native support for remote HTTP-based MCP tool servers and automated multi-agent delegation. Exposing an official example demonstrates cross-platform agentic security operations (SecOps), allowing autonomous tier-1 alert investigation, IOC enrichment, and automated incident triage across vendor ecosystems.
### ---
**Motivation and Objectives**
| Objective | Target Outcome | Value Proposition |
| :---- | :---- | :---- |
| **Specification Validation** | Validate OpenAI Agents API remote HTTP MCP client against Google Cloud OneMCP endpoints. | Ensures spec-compliant streaming and tool calling interoperability. |
| **Enterprise SecOps Workflow** | Demonstrate autonomous alert triage using UDM search and threat intelligence tools. | Reduces Mean Time to Detect (MTTD) and Triage (MTTR) for multi-model SecOps teams. |
| **Cross-Platform Enablement** | Provide a turnkey script demonstrating credential management and multi-agent delegation. | Equips field engineers and customers to connect existing SecOps tooling to external agent runtimes. |
### ---
**Component Mapping**
| OpenAI Agents API Parameter | Configuration / Value | SecOps OneMCP / mcp-security Equivalent |
| :---- | :---- | :---- |
| tools\[\].type | "mcp" | Open standard Model Context Protocol tool provider. |
| tools\[\].server\_label | "google\_secops" | Logical namespace for SecOps Chronicle / TI tools. |
| tools\[\].transport.type | "http" | Remote HTTP/SSE MCP transport layer. |
| tools\[\].transport.server\_url | Hosted SecOps endpoint (or reverse proxy) | SecOps OneMCP endpoint URL (e.g., https://chronicle.googleapis.com/mcp). |
| vault\_ids | \["vault\_gcp\_credentials"\] | Manages GCP OAuth2 access token or service account credentials. |
| multi\_agent.enabled | true | Coordinates specialized subagents (Detection, TI, Remediation). |
### ---
**Reference Implementation Code Sample**
`import OpenAI from "openai";`
`const client = new OpenAI();`
`/**`
`* Creates an autonomous SecOps investigation session using OpenAI Agents API`
`* backed by Google SecOps OneMCP / mcp-security HTTP server tools.`
`*/`
`const session = await client.beta.agents.sessions.create({`
`agent: {`
`model: "gpt-6-astra",`
`tools: [`
`{`
`type: "mcp",`
`server_label: "google_secops",`
`transport: {`
`type: "http",`
`server_url: process.env.SECOPS_ONEMCP_URL || "https://chronicle.googleapis.com/mcp",`
`},`
`},`
`],`
`multi_agent: {`
`enabled: true,`
`max_concurrent_subagents: 3,`
`},`
`},`
`vault_ids: [process.env.OPENAI_VAULT_GCP_ID || "vault_gcp_secops_prod"],`
`environment: {`
`type: "openai_hosted",`
`capability_directories: ["/workspace/capabilities/skills"],`
`},`
`input:`
`"Investigate high-severity alert 'Suspicious PowerShell Download Cradle' on host 'srv-app-04'. " +`
`"Delegate tasks across subagents: " +`
`"1. Subagent A: Query UDM events for process execution trees and network connections within +/- 15 minutes of alert time. " +`
`"2. Subagent B: Enrich all external destination IPs and file hashes via Google Threat Intelligence. " +`
`"3. Subagent C: Evaluate lateral movement indicators and assess user risk score. " +`
`"Synthesize all findings, IOC attribution, and containment recommendations into /workspace/outputs/incident_summary.md.",`
`});`
``console.log(`SecOps investigation session initiated: ${session.id}`);``
### ---
**Implementation Scope & Deliverables**
| Deliverable | Description | Primary Location |
| :---- | :---- | :---- |
| **Runnable Script** | Complete Node.js / TypeScript example initializing the agent session. | examples/openai-agents-api/investigate\_alert.ts |
| **Authentication Guide** | Documentation on handling GCP OAuth token injection via OpenAI Vault or API gateway headers. | examples/openai-agents-api/README.md |
| **Mock / Sandbox Runner** | Local test harness supporting recorded MCP server responses for CI validation. | examples/openai-agents-api/tests/ |
| **Architecture Diagram** | Visual layout mapping orchestrator, subagents, MCP protocol boundary, and SecOps APIs. | docs/architecture/openai\_agents\_onemcp.png |
### ---
**Technical Considerations & Prerequisites**
> 1. **Authentication Transport:**
* OneMCP endpoints on One Platform enforce IAM authorization and audit logging.
* The example must demonstrate injecting the Authorization header (Bearer \) into the remote HTTP transport or configuring OpenAI Vault to pass ambient workload identity.
> 2. **Tool Surface Curation:**
* Limit initial tool exposure to high-value investigative functions (UDM search, alert retrieval, rule evaluation, and IOC lookup) to minimize token consumption and avoid exceeding tool definition limits.
> 3. **Subagent Specialization:**
* Structure subagent prompts with strict scopes: evidence collection, threat intelligence correlation, and containment formulation.
### ---
**Acceptance Criteria**
> * Script successfully initializes a session against the Agents API using type: "mcp" and type: "http".
> * At least one tool call to a SecOps MCP method (e.g., list\_alerts or search\_udm\_events) completes and returns structured output.
> * Multi-agent subagents execute in parallel without session collisions.
> * Output artifacts are written to /workspace/outputs/incident\_summary.md.
> * Comprehensive README provided with prerequisites, environment variables, and execution steps.
Contributor guide
Research direction
Start by checking whether examples/openai-agents-api/investigate_alert.ts, examples/openai-agents-api/README.md, examples/openai-agents-api/tests/, and docs/architecture/openai_agents_onemcp.png exist, then review the repository's example and test conventions. The work is done when the script connects to the specified MCP endpoint, completes a tool call, runs parallel subagents, writes incident_summary.md, and documents prerequisites and execution steps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, node.js, typescript
- Domain
- ai, api, cloud, security, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100