Skip to main content
POST
https://api-production-56df.up.railway.app
/
events
curl -X POST https://api-production-56df.up.railway.app/events \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "event_id": "evt_a1b2c3d4-5678-9012-abcd-ef3456789012",
    "action": "github:pull_request:create",
    "timestamp": "2026-02-26T14:32:00Z",
    "agent": {
      "agent_id": "agent-codex-01",
      "agent_type": "coding_assistant",
      "framework": "custom",
      "model": "claude-sonnet-4-20250514"
    },
    "session": {
      "session_id": "sess_9f8e7d6c",
      "user_id": "user_42",
      "started_at": "2026-02-26T14:00:00Z"
    },
    "target": {
      "resource_type": "repository",
      "resource_id": "acme-corp/payments-service",
      "sensitivity_level": 3
    },
    "parameters": {
      "title": "Fix payment retry logic",
      "base_branch": "main",
      "head_branch": "fix/payment-retry",
      "files_changed": 4,
      "additions": 87,
      "deletions": 12
    },
    "mcp_context": {
      "server_name": "github-mcp",
      "server_id": "mcp_gh_01",
      "transport": "stdio",
      "is_verified": true,
      "tool_name": "create_pull_request"
    },
    "data_fields_accessed": [
      {"field": "api_key", "classification": "secret"},
      {"field": "retry_count", "classification": "public"}
    ],
    "preceding_actions": [
      "github:repository:clone",
      "filesystem:file:read",
      "filesystem:file:write",
      "github:branch:create"
    ],
    "user_context": "Fix the payment retry logic that causes duplicate charges after timeout",
    "metadata": {
      "ci_pipeline": "github-actions",
      "team": "payments"
    }
  }'
{
  "event_id": "evt_a1b2c3d4-5678-9012-abcd-ef3456789012",
  "status": "scored",
  "score": 62,
  "risk_level": "medium",
  "reasoning": "Agent created a pull request to a high-sensitivity repository (payments-service, sensitivity 3) and accessed a field classified as 'secret' (api_key). The action sequence is consistent with a legitimate code fix workflow, but the secret field access elevates the risk.",
  "violations": [
    "secret_field_access_in_pr"
  ],
  "scoring_source": "graph",
  "compliance_refs": [
    "EU_AI_Act:Article_14",
    "SOC2:CC6.1",
    "ISO_27001:A.9.4.1"
  ],
  "mitigations": [
    "Ensure api_key is not included in committed code or PR diff",
    "Require human review before merging to sensitive repositories",
    "Enable secret scanning on the repository"
  ],
  "score_components": [
    {"rule": "sensitivity_level_check", "contribution": 25},
    {"rule": "secret_field_access", "contribution": 20},
    {"rule": "pr_to_main_branch", "contribution": 10},
    {"rule": "session_action_coherence", "contribution": 7}
  ],
  "behavioral_flags": [],
  "graph_score": 62,
  "llm_score": null,
  "llm_fallback": false,
  "score_decomposition": {
    "graph_weight": 1.0,
    "llm_weight": 0.0,
    "gnn_weight": 0.0,
    "final": 62
  },
  "gnn_score": null,
  "confidence": 0.91,
  "rule_score": 62
}
Requires X-API-Key header for authentication.

Request Body

event_id
string
required
Unique identifier for this event. Must be globally unique across all submissions.
action
string
required
Action descriptor in domain:scope:verb format. Examples: github:pull_request:create, slack:message:send, filesystem:file:read.
timestamp
datetime
required
ISO 8601 timestamp of when the event occurred.
agent
object
Information about the AI agent that performed the action.
session
object
Session context for the event.
target
object
The resource being acted upon.
parameters
object
Arbitrary key-value parameters associated with the action. Schema varies by action type.
mcp_context
object
Model Context Protocol metadata, if the agent action was routed through an MCP server.
data_fields_accessed
array
List of data fields the agent accessed. Each item can be a plain string (field name) or an object with field and classification.
preceding_actions
array
Ordered list of action strings that occurred before this event in the same session. Used for behavioral sequence analysis.
user_context
string
Free-text description of what the user asked the agent to do. Provides intent context for scoring.
conversation_history
array
Array of conversation messages leading up to this action. Each item typically contains role and content fields.
metadata
object
Arbitrary metadata for custom integrations. Not used in scoring but stored with the event record.

Response

event_id
string
The event identifier echoed back from the request.
status
string
Processing status. Always scored for synchronous responses.
score
integer
Overall risk score from 0 (no risk) to 100 (critical risk).
risk_level
string
Human-readable risk level: none, low, medium, high, or critical.
reasoning
string
Natural language explanation of why this score was assigned.
violations
array
List of policy or compliance violations detected.
scoring_source
string
Which scoring engine produced the result: graph, llm, or hybrid.
compliance_refs
array
References to compliance framework articles relevant to this event (e.g., EU_AI_Act:Article_14, SOC2:CC6.1).
mitigations
array
Recommended mitigation actions to reduce risk.
score_components
array
Breakdown of individual scoring rule contributions.
behavioral_flags
array
Behavioral anomalies detected from session context and preceding actions.
graph_score
number
Score produced by the graph-based rule engine (0-100).
llm_score
number
Score produced by the LLM scorer, if invoked. null if graph confidence was sufficient.
llm_fallback
boolean
Whether the LLM was called because graph confidence was below the 0.8 threshold.
score_decomposition
object
Detailed breakdown of how the final score was composed from graph, LLM, and GNN components.
gnn_score
number
Score from the Graph Neural Network co-processor, if enabled. null otherwise.
confidence
number
Confidence level of the scoring result (0.0 to 1.0).
rule_score
number
Raw score from the deterministic rule engine before any adjustments.
curl -X POST https://api-production-56df.up.railway.app/events \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "event_id": "evt_a1b2c3d4-5678-9012-abcd-ef3456789012",
    "action": "github:pull_request:create",
    "timestamp": "2026-02-26T14:32:00Z",
    "agent": {
      "agent_id": "agent-codex-01",
      "agent_type": "coding_assistant",
      "framework": "custom",
      "model": "claude-sonnet-4-20250514"
    },
    "session": {
      "session_id": "sess_9f8e7d6c",
      "user_id": "user_42",
      "started_at": "2026-02-26T14:00:00Z"
    },
    "target": {
      "resource_type": "repository",
      "resource_id": "acme-corp/payments-service",
      "sensitivity_level": 3
    },
    "parameters": {
      "title": "Fix payment retry logic",
      "base_branch": "main",
      "head_branch": "fix/payment-retry",
      "files_changed": 4,
      "additions": 87,
      "deletions": 12
    },
    "mcp_context": {
      "server_name": "github-mcp",
      "server_id": "mcp_gh_01",
      "transport": "stdio",
      "is_verified": true,
      "tool_name": "create_pull_request"
    },
    "data_fields_accessed": [
      {"field": "api_key", "classification": "secret"},
      {"field": "retry_count", "classification": "public"}
    ],
    "preceding_actions": [
      "github:repository:clone",
      "filesystem:file:read",
      "filesystem:file:write",
      "github:branch:create"
    ],
    "user_context": "Fix the payment retry logic that causes duplicate charges after timeout",
    "metadata": {
      "ci_pipeline": "github-actions",
      "team": "payments"
    }
  }'
{
  "event_id": "evt_a1b2c3d4-5678-9012-abcd-ef3456789012",
  "status": "scored",
  "score": 62,
  "risk_level": "medium",
  "reasoning": "Agent created a pull request to a high-sensitivity repository (payments-service, sensitivity 3) and accessed a field classified as 'secret' (api_key). The action sequence is consistent with a legitimate code fix workflow, but the secret field access elevates the risk.",
  "violations": [
    "secret_field_access_in_pr"
  ],
  "scoring_source": "graph",
  "compliance_refs": [
    "EU_AI_Act:Article_14",
    "SOC2:CC6.1",
    "ISO_27001:A.9.4.1"
  ],
  "mitigations": [
    "Ensure api_key is not included in committed code or PR diff",
    "Require human review before merging to sensitive repositories",
    "Enable secret scanning on the repository"
  ],
  "score_components": [
    {"rule": "sensitivity_level_check", "contribution": 25},
    {"rule": "secret_field_access", "contribution": 20},
    {"rule": "pr_to_main_branch", "contribution": 10},
    {"rule": "session_action_coherence", "contribution": 7}
  ],
  "behavioral_flags": [],
  "graph_score": 62,
  "llm_score": null,
  "llm_fallback": false,
  "score_decomposition": {
    "graph_weight": 1.0,
    "llm_weight": 0.0,
    "gnn_weight": 0.0,
    "final": 62
  },
  "gnn_score": null,
  "confidence": 0.91,
  "rule_score": 62
}