{
  "openapi": "3.1.0",
  "info": {
    "title": "Hunch Security Intelligence",
    "version": "0.3.0",
    "description": "Read-only observations for RH / Robinhood Chain agents. No custody, signing, or automatic runtime enforcement. Public API: 40 requests/minute/IP with shared provider limits. Missing required evidence requires review."
  },
  "servers": [
    {
      "url": "https://hunchagents.xyz"
    }
  ],
  "paths": {
    "/api/rh/intelligence": {
      "post": {
        "operationId": "intelligence",
        "summary": "Read token intelligence",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "minLength": 42,
                    "maxLength": 42,
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "RH mainnet token contract address"
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check completed. Inspect coverage, decision, and limitations. This is not signing approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenIntelligence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or unsupported/incomplete evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 20 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Client or shared capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/rh/assess": {
      "post": {
        "operationId": "assess",
        "summary": "Assess an action under an operator-selected profile",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "minLength": 42,
                    "maxLength": 42,
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "RH mainnet token contract address"
                  },
                  "amountUsd": {
                    "type": "number",
                    "minimum": 0
                  },
                  "slippageBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "conservative",
                      "standard"
                    ],
                    "default": "conservative"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 12000
                  }
                },
                "required": [
                  "address",
                  "amountUsd",
                  "slippageBps"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check completed. Inspect coverage, decision, and limitations. This is not signing approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionAssessment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or unsupported/incomplete evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 20 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Client or shared capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/rh/simulate": {
      "post": {
        "operationId": "simulate",
        "summary": "Simulate an EVM call without broadcasting",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transaction": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "minLength": 42,
                        "maxLength": 42,
                        "pattern": "^0x[0-9a-fA-F]{40}$",
                        "description": "RH mainnet token contract address"
                      },
                      "to": {
                        "type": "string",
                        "minLength": 42,
                        "maxLength": 42,
                        "pattern": "^0x[0-9a-fA-F]{40}$",
                        "description": "RH mainnet token contract address"
                      },
                      "data": {
                        "type": "string",
                        "maxLength": 16386,
                        "pattern": "^0x([0-9a-fA-F]{2})*$"
                      },
                      "value": {
                        "type": "string"
                      },
                      "gas": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "from",
                      "to",
                      "data"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "transaction"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check completed. Inspect coverage, decision, and limitations. This is not signing approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Simulation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or unsupported/incomplete evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 20 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Client or shared capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/text": {
      "post": {
        "operationId": "text",
        "summary": "Inspect text using six deterministic heuristics",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 12000
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check completed. Inspect coverage, decision, and limitations. This is not signing approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or unsupported/incomplete evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 20 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Client or shared capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/capabilities": {
      "get": {
        "operationId": "capabilities",
        "summary": "Read available operations and fixed policy profiles",
        "responses": {
          "200": {
            "description": "Current capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "TokenIntelligence": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "address",
          "observedAt",
          "status",
          "contract",
          "holders",
          "markets",
          "coverage",
          "findings",
          "limitations"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "address": {
            "type": "string",
            "minLength": 42,
            "maxLength": 42,
            "pattern": "^0x[0-9a-fA-F]{40}$",
            "description": "RH mainnet token contract address"
          },
          "network": {
            "const": "robinhood-mainnet"
          },
          "status": {
            "type": "string",
            "enum": [
              "incomplete",
              "attention",
              "observations_complete"
            ]
          },
          "contract": {
            "type": "object",
            "additionalProperties": true
          },
          "holders": {
            "type": "object",
            "additionalProperties": true
          },
          "markets": {
            "type": "object",
            "additionalProperties": true
          },
          "coverage": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ActionAssessment": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "observedAt",
          "decision",
          "profile",
          "proposal",
          "reasons",
          "report",
          "enforcement"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "decision": {
            "type": "string",
            "enum": [
              "block",
              "review"
            ]
          },
          "profile": {
            "type": "object",
            "additionalProperties": true
          },
          "proposal": {
            "type": "object",
            "additionalProperties": true
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "report": {
            "$ref": "#/components/schemas/TokenIntelligence"
          },
          "textReport": {
            "$ref": "#/components/schemas/TextReport"
          },
          "enforcement": {
            "type": "string"
          }
        }
      },
      "Simulation": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "observedAt",
          "status",
          "block",
          "error",
          "returnData",
          "settings",
          "limitations"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "simulation_succeeded",
              "simulation_failed"
            ]
          },
          "block": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "error": {},
          "gasEstimate": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnData": {
            "type": [
              "string",
              "null"
            ]
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TextReport": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "kind",
          "observedAt",
          "inputSha256",
          "status",
          "findings",
          "checks",
          "scope",
          "limitations"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "review_required",
              "review_recommended",
              "no_pattern_matches"
            ]
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "scope": {
            "type": "string"
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
