Skip to content

Commit eee9167

Browse files
shivdeep1claude
andcommitted
feat: default to central Airlock registry (api.airlock.ing)
All SDK and CLI calls now route through the central Airlock trust registry by default — the same model npm uses with registry.npmjs.org. - AirlockClient() defaults to https://api.airlock.ing - airlock verify defaults to https://api.airlock.ing - airlock init scaffolds config pointing to api.airlock.ing - Self-hosting supported via AIRLOCK_GATEWAY_URL env-var or explicit arg - AIRLOCK_REGISTRY_URL exported for programmatic access Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 699276f commit eee9167

3 files changed

Lines changed: 31 additions & 10 deletions

File tree

airlock/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from airlock.client import ( # noqa: F401
2+
AIRLOCK_REGISTRY_URL,
23
AgentRegistration,
34
AirlockClient,
45
AirlockError,

airlock/cli.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,21 @@ def cli() -> None:
4141
@click.argument("did_or_url")
4242
@click.option(
4343
"--gateway",
44-
default="http://127.0.0.1:8000",
45-
show_default=True,
46-
help="Airlock gateway URL to verify against.",
44+
default=None,
45+
show_default="https://api.airlock.ing",
46+
help="Airlock gateway URL. Defaults to central registry. Set AIRLOCK_GATEWAY_URL to override globally.",
4747
)
48-
def verify(did_or_url: str, gateway: str) -> None:
48+
def verify(did_or_url: str, gateway: str | None) -> None:
4949
"""Verify an agent's identity against a running Airlock gateway.
5050
5151
DID_OR_URL is a DID string (did:key:z6Mk...) or an agent endpoint URL.
5252
The command registers a temporary agent, performs a signed handshake,
5353
and prints the verification result.
5454
"""
55-
_run_async(_verify_agent(did_or_url, gateway))
55+
import os
56+
57+
resolved_gateway = gateway or os.environ.get("AIRLOCK_GATEWAY_URL", "https://api.airlock.ing")
58+
_run_async(_verify_agent(did_or_url, resolved_gateway))
5659

5760

5861
async def _verify_agent(did_or_url: str, gateway_url: str) -> None:
@@ -316,7 +319,7 @@ def _build_agent_card(kp: Any) -> dict[str, Any]:
316319
"description": "An AI agent protected by Airlock Protocol",
317320
"did": kp.did,
318321
"public_key_multibase": kp.public_key_multibase,
319-
"endpoint_url": "http://localhost:8000",
322+
"endpoint_url": "https://api.airlock.ing",
320323
"protocol_versions": ["0.1.0"],
321324
"capabilities": [
322325
{
@@ -333,7 +336,7 @@ def _build_agent_card(kp: Any) -> dict[str, Any]:
333336
# Docs: https://github.com/shivdeep1/airlock-protocol
334337
335338
gateway:
336-
url: "http://127.0.0.1:8000"
339+
url: "https://api.airlock.ing"
337340
338341
agent:
339342
# Path to your agent's Ed25519 seed file

airlock/client.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,26 @@
1414
from __future__ import annotations
1515

1616
import asyncio
17+
import os
1718
from dataclasses import dataclass, field
1819
from typing import Any
1920

2021
import httpx
2122

23+
# ---------------------------------------------------------------------------
24+
# Central registry URL — the default trust verification endpoint.
25+
#
26+
# Every ``AirlockClient()`` and ``airlock verify`` call routes through this
27+
# registry unless explicitly overridden. The registry holds the global
28+
# trust scores, issuer database, and reputation history. Self-hosting is
29+
# supported via the ``AIRLOCK_GATEWAY_URL`` env-var or the *gateway_url*
30+
# constructor argument, but the central registry is the recommended default.
31+
# ---------------------------------------------------------------------------
32+
AIRLOCK_REGISTRY_URL = os.environ.get(
33+
"AIRLOCK_GATEWAY_URL",
34+
"https://api.airlock.ing",
35+
)
36+
2237

2338
@dataclass(frozen=True)
2439
class VerifyResult:
@@ -57,15 +72,17 @@ class AirlockClient:
5772
"""Simple SDK client for the Airlock trust verification protocol.
5873
5974
Args:
60-
gateway_url: Base URL of a running Airlock gateway.
61-
Defaults to ``http://localhost:8000``.
75+
gateway_url: Base URL of an Airlock gateway. Defaults to the
76+
central Airlock registry at ``https://api.airlock.ing``.
77+
Override with ``AIRLOCK_GATEWAY_URL`` env-var or pass explicitly
78+
to self-host.
6279
timeout: HTTP request timeout in seconds. Defaults to 30.
6380
service_token: Optional bearer token for authenticated endpoints.
6481
"""
6582

6683
def __init__(
6784
self,
68-
gateway_url: str = "http://localhost:8000",
85+
gateway_url: str = AIRLOCK_REGISTRY_URL,
6986
*,
7087
timeout: float = 30.0,
7188
service_token: str | None = None,

0 commit comments

Comments
 (0)