Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lasscyber.com/llms.txt

Use this file to discover all available pages before exploring further.

Agnes ships two official SDKs: Both wrap the same HTTP API (https://api.lasscyber.com), share one OpenAPI contract, and expose the same ergonomic surface:
  • Agnes / AsyncAgnes (Python) and Agnes (TypeScript) — the primary client.
  • analyze() — single hero call that returns a typed Decision.
  • guard() — context that wraps an LLM call with check_input / check_output and auto-flips inbound ↔ outbound policies.
  • PolicyBuilder — fluent builder for combined policies in code.
  • Typed errors mapping 1:1 to the canonical error codes.
  • Pagination helpers for resource list endpoints.
  • A raw / agnes.raw escape hatch that exposes the auto-generated low-level client for any endpoint not yet wrapped by the ergonomic surface.
  • Optional OpenAI drop-in integration via a separate subpath export.

Surface comparison

ConceptPythonTypeScript
ClientAgnes() / AsyncAgnes()new Agnes()
Analyzeagnes.analyze("...", policy="...")await agnes.analyze("...", { policy: "..." })
Guardwith agnes.guard(policy="...") as guard:const guard = agnes.guard({ policy: "..." })
Policy builderPolicyBuilder("name").prompt_injection_jailbreak(...).build()new PolicyBuilder("name").promptInjectionJailbreak(...).build()
Paginationfor x in agnes.policies.list(): ...for await (const x of agnes.policies.list()) { ... }
ErrorsBlocked, RateLimitError, …Blocked, RateLimitError, …
The naming convention is the standard split:
  • Pythonsnake_case everywhere. Canonical analyzer names use underscores (prompt_injection_jailbreak).
  • TypeScriptcamelCase everywhere. Canonical analyzer names drop the dashes (promptInjectionJailbreak).
Both SDKs translate to the wire-format server keys at request time.

Choosing an SDK

  • Python for backend services, ML pipelines, scripts, and notebooks. Both sync (Agnes) and async (AsyncAgnes) clients are shipped; pick whichever matches your service.
  • TypeScript for browser apps (your dashboard talking to your service that wraps Agnes), server-side Node, edge runtimes (Cloudflare Workers, Vercel Edge, Deno, Bun), and front-end build pipelines. The default entry is fully isomorphic.
You should not put an ak_* Agnes API key into a browser bundle — treat keys as secrets. The TypeScript SDK’s edge-runtime support is about server-side / worker-side environments, not “drop the key in your React app”.

Installation

pip install agnes-security

Authentication

Both SDKs read AGNES_API_KEY from the environment by default. See Authentication for the full table of ways to pass keys, including Agnes-Version pinning.

Compatibility

  • Python: 3.9+ supported. Type stubs ship with the package.
  • TypeScript: Node 18+, browsers, Deno, Bun, Cloudflare Workers. No Node-specific imports in the default entry.
The OpenAI integrations are optional extras behind subpath imports; callers who never use them pay zero bundle / dependency cost.
pip install "agnes-security[openai]"

Versioning

The SDKs follow Semantic Versioning, and each language SDK versions independently from the server’s date-based API contract. See Versioning for the full lifecycle and the analyzer-name evolution rules.

Where next

  • Python SDK — quickstart, errors, pagination, OpenAI drop-in.
  • TypeScript SDK — same content for the TypeScript world.
  • Versioning — SemVer for SDKs, dates for the server.
  • Sandbox mode — exercise either SDK in CI without billing.