SDKs & Libraries

GovernLayer provides a Python SDK and comprehensive REST API. The API follows standard REST conventions, so any HTTP client works out of the box.

Official libraries

PHP

A popular general-purpose scripting language that is especially suited to web development.

Read more

Ruby

A dynamic, open source programming language with a focus on simplicity and productivity.

Read more

Node.js

Node.js® is an open-source, cross-platform JavaScript runtime environment.

Read more

Python

Python is a programming language that lets you work quickly and integrate systems more effectively.

Read more

Go

An open-source programming language supported by Google with built-in concurrency.

Read more

Python SDK

Install

pip install governlayer

Usage

from governlayer import GovernLayerClient

client = GovernLayerClient(api_key="gl_your_api_key_here")

# Run full governance pipeline
result = client.govern(
    system_name="my-agent",
    behavior="Denied access to authorized user",
    expected_behavior="Grant access to authorized users",
    framework="SOC2",
)

print(result.drift_score)   # 0.82
print(result.decision)      # "ESCALATE"
print(result.ledger_hash)   # "sha256:..."

Direct REST API

The REST API is available at https://api.governlayer.ai. All endpoints accept and return JSON.

cURL example

curl -X POST https://api.governlayer.ai/v1/govern \
  -H "X-API-Key: gl_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"system_name": "my-agent", "behavior": "...", "framework": "SOC2"}'

Was this page helpful?