Download the PHP package agentadmit/agentadmit-sdk without Composer

On this page you can find all versions of the php package agentadmit/agentadmit-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package agentadmit-sdk

AgentAdmit SDK for PHP (Laravel)

User-mediated AI agent authorization. Plug-and-play for any Laravel app.

Get started: Sign up at agentadmit.com → Get your test keys → Install the SDK → Build. Test keys are available immediately after signup. Live keys become available when you subscribe an app.

Quick Start

Add your credentials to .env:

Add scope enforcement to any route:

Your app now supports AI agent connections with:

How It Works

  1. User clicks "AgentAdmit" in your app
  2. Selects scopes and connection duration
  3. Gets a token to give to their AI agent
  4. Agent exchanges the token for scoped API access
  5. User revokes anytime

The token goes to the human, not the agent. No automated delivery = no prompt injection surface.

Important

Mandatory introspection. All token validation goes through api.agentadmit.com. There is no self-hosted mode. No local JWT validation. No bypass. This is required for security, audit logging, and scope enforcement.

Admin revocation. As the app operator, you can revoke any user's agent connection by calling TokensClient::revoke($connectionId) from your backend (requires your operator API key).

Embeddable admin panel. Drop the <AgentAdmitAdminPanel> React component into your admin section to view all agent connections, usage metrics, billing status, and revoke any connection without leaving your app. See the React SDK for details.

In-app AI scopes. If your app has built-in AI features (analysis, plan generation, photo recognition), do not expose those as agent scopes. The user's AI agent can read the raw data and do the analysis itself. Exposing in-app AI endpoints to agents creates double cost.

Consent Ledger (Caller-Identity Consent)

AgentAdmit can host per-user consent switches for three independent caller classes: human_session, in_app_ai, and external_agent. No class's setting implies another's.

External agents: the verify result already carries the verdict:

consentGranted() fails closed when the verdict is absent (the hosted service omits it while its consent store is unreadable). To keep serving during that degraded mode, resolve an absent verdict authoritatively with ConsentClient::checkConsent($result->userId, 'external_agent') — the CallerConsent middleware does this for you.

Human sessions and in-app AI never hold AgentAdmit tokens, so ask directly:

Consent is orthogonal to revocation: a denied verdict means your app returns its own 403; the connection and token stay valid so the user can flip consent back on without re-connecting. Write switches through PUT /api/v1/consent/settings from your backend; export the audit trail with GET /api/v1/consent/export (every plan).

One-middleware drop-in. Instead of wiring the three paths by hand, the agentadmit.caller_consent middleware classifies the caller from the credential and evaluates the right independent path:

External agents are checked via hosted introspection (consent verdict plus scope); in-app AI via the Consent Ledger (fail closed); the human path defers to your own permission model unless caller_consent.gate_human is true. It is a consent gate, not an authenticator, so register it after your own authentication.

Presence Verification (WebAuthn Step-Up)

AgentAdmit can require the human behind a connection to complete a WebAuthn presence ceremony on the consent page. The verify result carries the outcome as an additive presence block, and the SDK surfaces it next to the consent verdict:

Or enforce it per route with the fail-closed middleware:

presenceVerified() is strict: it returns true only when the platform reports verified: true. Connections minted without a ceremony, malformed blocks, and older servers that omit the block entirely all count as not verified, so guarded routes return a 403 with error: presence_required. Unlike consent, absence does not mean allowed: presence fails closed because a missing block means no ceremony was ever proven.

Declared Purpose

Declared purpose: the user-facing reason recorded on the grant at the consent moment. Review-time record only, never an enforcement input; authorization decisions ride scopes, connection status, and consent.

Pass an optional purpose (max 300 characters) when issuing a connection token. AgentAdmit shows it to the human on the consent page ("Declared purpose: …"), records it on the grant, stamps it into every audit log row, and returns it from /verify introspection:

The SDK rejects purposes longer than 300 characters client-side with an InvalidArgumentException; when you pass no purpose, the field is omitted from the request entirely.

On the verify side, the result carries the nullable purpose for display and review:

purpose is null for connections minted without one and on older servers that omit the field. Do not branch authorization on it - /verify never gates on the purpose, and neither should your app.

User-Declared Intent

User-declared intent: the user's own words, typed by the human at the consent moment. It is distinct from purpose - purpose is the app's words, user_intent is the user's. Like the declared purpose, it is a review-time record only, never an enforcement input; authorization decisions ride scopes, connection status, and consent.

Pass an optional user_intent (1-300 characters) when issuing a connection token. It flows exactly like the declared purpose: recorded on the grant, returned from /verify introspection, stamped into audit log rows, and carried on ledger events. When the hosted presence ceremony runs, the user-declared intent is included in the verifiable-consent-evidence commitment.

Outbound validation mirrors purpose: a user_intent longer than 300 characters, or any non-string, non-null value, throws InvalidArgumentException client-side before any request is sent - the user's own typed words are never silently discarded. null and the empty string are simply omitted from the request. (Verify-side parsing stays tolerant: a malformed user_intent in the /verify response is normalized to null, never a failure.)

On the verify side, the result carries the nullable user-declared intent for display and review:

userIntent is null for connections minted without one and on older servers that omit the field. Do not branch authorization on it - like the purpose, /verify never gates on it, and neither should your app.

App-Attested Presence

If your app gates token minting behind its own embedded passkey/WebAuthn ceremony, AgentAdmit never witnesses that ceremony (it is origin-bound), so by default the hosted service reports presence.verified: false for those connections. Attest the ceremony fact at issuance to close that gap - AFTER verifying and consuming your own fresh, purpose-bound attestation:

The SDK sends it as presence: {verified: true, uv: true, method, verified_at} - verified/uv are literal true by construction and the class cannot represent anything else. The hosted service validates freshness (10-minute window, 60 s future clock-skew slack) and stores the method provenance-marked app:<method> so app-attested facts stay distinct from ceremonies AgentAdmit witnessed itself. Introspection, the grant-event ledger, and the evidence API then carry presence.verified: true for the connection.

Honesty ceiling: this is your app's attestation, recorded and provenance-marked. It is not witnessed by AgentAdmit and not independently verifiable. Only attest a ceremony that verified the user with UV (biometric or PIN user verification); a ceremony without UV carries no presence fact, so pass null (the default). An out-of-contract method (^[a-z0-9_]+$, 1-60) throws InvalidArgumentException at construction, before any request; verified_at serializes RFC 3339 with an explicit offset because DateTimeInterface always carries a timezone.

Per-Call Audit Telemetry

Every verified call reports what it actually exercised. On each introspection the SDK sends, alongside the token, the scope the middleware enforced for that call (scope_used), the request path (endpoint), and the HTTP method (method), and the hosted service records them in the app's tamper-evident audit log — so an audit row answers "which scope, which endpoint, which method" per call, not just "a token was checked".

The scope middlewares (agentadmit.scope, agentadmit.scope_if_agent) report all three automatically — the middleware parameter is the enforced scope:

agentadmit.presence reports endpoint and method only. agentadmit.caller_consent:<scope> reports all three and sets the hosted consent-first guard automatically, so denied caller classes receive no scope-state disclosure. Direct client calls send whatever you provide — every telemetry argument is optional and the signature stays backward-compatible:

Honesty rules:

Hosted refusals fail closed

As of 1.10.0 the SDK also treats an active: true introspection response that carries a string error field as a refusal of that call, never a pass-through:

IntrospectionClient::verify() surfaces these as VerificationDeniedException (a 403 AgentAdmitException subclass); getDenialBody() is the exact JSON body the middlewares return.

Rate Limiting

The AgentAdmit introspection endpoint enforces rate limits. The PHP SDK handles HTTP 429 responses automatically with exponential backoff and jitter - no changes needed in your middleware code.

Retry behavior

Parameter Default Description
Initial delay 1 second First retry wait
Backoff multiplier 2× Doubles each retry
Cap 30 seconds Maximum wait per retry
Jitter 0–500 ms Random addition to each delay
Max retries 3 Configurable

The SDK also respects the Retry-After response header - if present, it overrides the computed backoff delay.

Configuring max retries

In config/agentadmit.php or .env:

Handling exhausted retries

When all retries are exhausted, IntrospectionClient::verify() throws RateLimitException:

RateLimitException methods:

Documentation

Full integration guide: https://agentadmit.com/docs/app-owner-guide

Data Collection & Privacy

The AgentAdmit PHP SDK runs server-side and does not interact with app stores or end-user devices directly.

What the SDK does

What the SDK does NOT do

What the AgentAdmit hosted service records

On every token validation, AgentAdmit's /api/v1/verify endpoint receives the access token and API key, resolves the token to its user_id, connection_id, granted scopes, and agent_label, and records per-call metadata (including the endpoint and timestamp) for billing, audit logging, the security alerts engine, and usage metering. This is integral to how AgentAdmit works and applies to both test and live keys. See the "Mandatory introspection" notes above and the compliance guide for the full data-handling description.

Privacy impact

Since this SDK runs on your server, it has no direct App Store or Play Store compliance surface. Your client-side integration (e.g., the AgentAdmit React SDK) handles privacy manifest and data safety requirements.

For complete compliance guidance, see our compliance guide.

License

All rights reserved. Patent pending.

Security Alerts

Six alert type constants on AlertsClient.

Configure

List Events

Get Config

Notifying Your Users

AgentAdmit detects anomalies, fires alerts, and (with kill switch) auto-revokes connections. How you notify your own users is up to you. AgentAdmit provides the data - you deliver it through your own system (in-app notifications, email, push, etc.).

Issuing & Exchanging Tokens


All versions of agentadmit-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0
illuminate/http Version ^10.0|^11.0
symfony/http-foundation Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package agentadmit/agentadmit-sdk contains the following files

Loading the files please wait ...