GebSecure Docs v0.1.0

Get started

Core concepts

Principals, actions and resources, decisions, environments, policies, approvals, connections and the audit log.

Tenancy#

Every resource belongs to an organization. An organization contains workspaces, a workspace contains projects, and a project contains environments. A new organization starts with a default project whose environments are development, staging and production; each environment has a slug and a tier (development, staging or production). Agents, connections and environment-scoped policies live in one environment, and PostgreSQL row-level security confines every query to the caller's organization (ADR 0003).

Principals and credentials#

A principal is whoever makes a request. The principal types are user, agent, service_account, application and api_key. Agents and other machine principals authenticate with credentials whose secrets are shown exactly once and stored only as hashes:

Prefix Credential Used for
gsa_… client secret of an agent, service account or application exchanged at POST /v1/auth/token (grant_type=client_credentials) for a short-lived access token
(none) private_key_jwt public key the agent signs a client assertion (Ed25519, ES256 or RS256); GebSecure stores only the public JWK
gsk_… API key sent directly as Authorization: Bearer gsk_…
gsd_… delegation token exchanged with RFC 8693 token exchange so one agent can act for another with a subset of its scopes
gsr_… refresh token rotating user and machine refresh tokens
gss_… SCIM token identity-provider provisioning at /scim/v2

Access tokens are EdDSA-signed JWTs (default lifetime ACCESS_TOKEN_TTL = 10 minutes) verified against GET /.well-known/jwks.json. The SDKs exchange, cache and refresh them for you. See Identity.

Actions and resources#

An action names what the agent wants to do, as service:verb — letters, digits and _ . : / * @ -, for example support:tickets.read, stripe:refunds.create or github:repos.get. A resource names what it acts on, free-form up to 1024 characters, for example ticket:T-1042 or billing:charge/ch_0977. Policies match both with wildcards: * matches within one /-separated segment, ** across segments, ? one character (stripe:*, github:repo/acme/**).

Actions run through GebSecure get their names from the platform:

Runtime Action Resource
Connector execution (POST /v1/execute) <connector key>:<connector action>, e.g. rest:refunds.create rendered by the connector from the input, e.g. billing:charge/ch_0977
MCP tool call mcp:<server slug>/<tool> mcp:<server slug>/<tool>
MCP resource read mcp:<server slug>/resources.read mcp:<server slug>/resource/<uri>

The request context (amounts, recipients, tool arguments…) is available to policies as context.*.

Decisions#

POST /v1/authorize returns one of three decisions, never an error for a denial:

  • ALLOW — a permit policy applies, no forbid matched, no approval gate triggered and the risk score is below the thresholds.
  • DENY — a forbid policy matched, no permit applied (default deny), or the risk score is above denyAbove.
  • APPROVAL_REQUIRED — a gate requires a human: a require approval clause, a require_approval policy, a risk score above approvalAbove, outbound DLP, or a tainted agent attempting a write.

This is a real response (a dry run of the example agent's $400 refund):

json
{
  "decision": "APPROVAL_REQUIRED",
  "decisionId": "dec_01m3v7a87548rr1xt43sfn9b2c",
  "reason": "Approval required by \"support-refunds\"",
  "risk": {
    "score": 23,
    "level": "low",
    "recommendation": "allow",
    "signals": [
      { "category": "action", "code": "action.write", "points": 18, "reason": "write action (rest:refunds.create)" },
      { "category": "agent", "code": "agent.new", "points": 5, "reason": "agent registered in the last 24h" }
    ],
    "thresholds": { "approvalAbove": 75, "denyAbove": 95 }
  },
  "approval": null,
  "explanation": {
    "trace": [
      {
        "policyId": "pol_01m3v7a50j455dftjhd5bvgwkd#support-refunds",
        "versionId": "polv_01m3v7a52nzvx0cp2n53atw59a",
        "name": "support-refunds",
        "effect": "permit",
        "source": "policy",
        "scope": { "type": "environment", "id": "env_01m3v7a2k0z5thj426443kz3xx" },
        "outcome": "applied",
        "detail": "approval required by permit"
      }
    ],
    "approvals": [
      {
        "policyId": "pol_01m3v7a50j455dftjhd5bvgwkd#support-refunds",
        "policyName": "support-refunds",
        "approvers": [{ "kind": "role", "value": "owner" }],
        "min": 1,
        "mode": "parallel",
        "expiresMs": 3600000
      }
    ],
    "grantingPolicyId": "pol_01m3v7a50j455dftjhd5bvgwkd#support-refunds",
    "candidates": 1,
    "policyDecision": "APPROVAL_REQUIRED"
  },
  "limits": [
    {
      "policyId": "pol_01m3v7a50j455dftjhd5bvgwkd#support-refunds",
      "key": "pol_01m3v7a50j455dftjhd5bvgwkd#support-refunds:0:d81f999565c6",
      "measure": "sum",
      "amount": 400,
      "max": 2000,
      "windowMs": 86400000,
      "subject": "p:agt_01m3v7a6hyaejr8k5rnbbrskje",
      "used": 0,
      "remaining": 1600
    }
  ],
  "snapshotHash": "204566e44bd0c3dd0e669bc91c978b79e02d8929bbd0a6ef72c74e1abf70f0af",
  "environment": { "id": "env_01m3v7a2k0z5thj426443kz3xx", "slug": "development", "tier": "development" },
  "principal": { "type": "agent", "id": "agt_01m3v7a6hyaejr8k5rnbbrskje" },
  "dryRun": true,
  "evaluatedAt": "2026-10-01T07:54:26.423Z",
  "durationMs": 18.05
}

A dry run ("dryRun": true) evaluates without side effects, so approval is null. Without it, GebSecure creates (or reuses) a pending approval request bound to snapshotHash and returns it in approval (id, status, expiresAt, snapshotHash, url, created).

Policies#

Policies are written in the GebSecure Policy Language (GSL), saved as immutable versions, tested, simulated and deployed per scope (organization, project or environment). Only the deployed version is evaluated. The combining rule: an explicit forbid overrides everything → no applicable permit means deny → any triggered approval gate means APPROVAL_REQUIRED → otherwise ALLOW. Evaluation fails closed: a missing attribute or a type error makes a forbid apply and a permit not apply. See GSL.

Risk#

Every decision carries a risk score from 0 to 100 built from explainable signals (action category, agent age, velocity, prompt-injection taint, sensitive data…), a level (low, medium, high, critical) and a recommendation. Scores above approvalAbove (default 75) require approval and above denyAbove (default 95) deny; risk can only tighten a decision. Policies can use the score with risk above / risk below or the risk variable.

Approvals#

An approval request is bound to the exact action snapshot (principal, action, resource, context and execution details, hashed and signed) and is consumed once. Reviewers decide in the console, through the API or from Slack; requesters can never approve their own actions. See Approvals.

Connectors and connections#

A connector is an integration in the catalog (GET /v1/connectors): Stripe, GitHub, Slack, AWS, a generic rest connector and more, each with typed actions and risk metadata. A connection is a connector installed in a project with configuration and a credential from the vault. POST /v1/execute runs an action of a connection in a sandbox; the broker injects the credential only for the connection's allowed hosts. See Credential broker and vault.

Audit and traces#

Decisions, executions, approvals and administrative changes are written to the audit log in the same transaction as the change and chained per organization with SHA-256 (POST /v1/audit/verify checks the chain). Every request carries a W3C traceparent; agents can report their own spans so one trace shows the model's steps next to GebSecure's decisions. See Audit.