Skip to content

Licensing

Madhyamas Enterprise requires a valid license file for production use. Licenses are Ed25519-signed JSON documents that encode the customer, plan, seat count, expiry, and enabled features.

License Installation

Via CLI Flag

bash
madhyamas --license-file /path/to/license.json

Via Environment Variable

bash
export MADHYAMAS_LICENSE_FILE=/path/to/license.json
madhyamas

Via Docker

yaml
# docker-compose.yml
services:
  madhyamas:
    environment:
      MADHYAMAS_LICENSE_FILE: /licenses/license.json
    volumes:
      - ./licenses:/licenses:ro

Via Kubernetes Secret

bash
kubectl create secret generic madhyamas-license \
  --from-file=license.json=/path/to/license.json
yaml
# deployment.yaml
spec:
  containers:
    - name: madhyamas
      env:
        - name: MADHYAMAS_LICENSE_FILE
          value: /licenses/license.json
      volumeMounts:
        - name: license
          mountPath: /licenses
          readOnly: true
  volumes:
    - name: license
      secret:
        secretName: madhyamas-license

License Verification

On startup, Madhyamas verifies the license:

  1. Signature verification — Ed25519 signature is checked against the embedded public key (the madhyamas product's key; licenses are issued per product by the ShristiLabs licensing platform)
  2. Expiry check — License must not be expired
  3. Instance ID check — If the license specifies an instance ID, it must match --instance-id
  4. Product check — The license's product_id claim must be madhyamas (licenses issued for other ShristiLabs products are rejected)
  5. Feature check — Enabled features are loaded from the license

If verification fails, Madhyamas starts in unlicensed mode with a warning. All features continue to work, but a banner is displayed in the web UI.

License file format

json
{
  "license_id": "lic_abc123",
  "product_id": "madhyamas",
  "customer": "Acme Corp",
  "plan": "enterprise",
  "seats": 50,
  "instance_id": "inst_xyz789",
  "issued_at": "2026-01-01T00:00:00Z",
  "expires_at": "2027-01-01T00:00:00Z",
  "features": ["auth", "rbac", "audit", "oidc", "mfa"],
  "signature": "base64_ed25519_signature_of_canonical_json"
}

The required product_id field (claims format v2, 2026-08) scopes the license to a product. Licenses issued before this field existed (v1) fail with a parse error — re-download the license from the portal.

License Details

The License admin panel shows full license information:

Enterprise license panel

Accessing the Panel

  1. Log in as an admin
  2. Click the License icon in the navigation rail

Information Displayed

FieldDescription
License IDUnique license identifier
CustomerLicensed organization name
PlanPricing tier (Trial, Starter, Pro, Enterprise, Academic)
Instance IDBound instance ID (if any)
IssuedIssue date
ExpiresExpiration date
Days RemainingDays until expiration (with warning if < 30)
SeatsNumber of licensed seats
Seat UsageCurrent seats used / total
Enabled FeaturesList of features enabled by the license

Seat Management

Seats are the number of concurrent Madhyamas instances allowed by the license. Each running instance consumes one seat.

How Seat Tracking Works

  1. Registration — On startup, the instance registers itself in Redis with a TTL of 120 seconds
  2. Heartbeat — The instance sends a heartbeat every 60 seconds, refreshing the TTL
  3. Enforcement — If active_seats >= license_seats, the new instance fails to start
  4. Release — On graceful shutdown (SIGTERM), the instance deregisters and releases its seat
  5. Auto-reap — If an instance crashes without deregistering, its seat is released when the TTL expires

Atomic registration

Seat registration uses a Redis Lua script for atomic ZADD + EXPIRE, preventing race conditions where two instances could register simultaneously and exceed the seat limit.

CLI

bash
madhyamas license info

API

bash
curl -H "Authorization: Bearer <token>" \
  http://localhost:3001/api/license/info

Pricing Tiers

PlanSeatsPriceFeatures
Trial5Free (30 days)All enterprise features
Starter10$49/mo or $490/yrAll enterprise features
Pro50$199/mo or $1,990/yrAll enterprise features + priority support
EnterpriseUnlimited$499/mo or $4,990/yrAll features + SSO + dedicated support
AcademicUnlimitedFreeRequires .edu email

License Portal

Licenses are managed through the Madhyamas license portal:

  1. Register — Create an organization account
  2. Select a plan — Choose a pricing tier
  3. Pay — Stripe Checkout for credit card payment
  4. Download — Get your Ed25519-signed license file
  5. Install — Point --license-file at the downloaded file

Air-Gapped / Offline Licensing

For environments without internet access:

  1. Contact sales@madhyamas.ai to purchase a license
  2. Receive the license file via secure email or physical media
  3. Install via --license-file

Offline licenses are verified entirely locally using the embedded Ed25519 public key — no phone-home or online verification required.

Renewal

Licenses can be renewed through the portal:

  1. Log in to madhyamas.ai
  2. Navigate to your license dashboard
  3. Click Renew and complete payment
  4. Download the new license file
  5. Replace the old file and restart Madhyamas

Zero-downtime renewal

In a multi-instance deployment, replace the license file on each instance one at a time. Instances with the old license continue working until restarted.

Transfer

Licenses can be transferred between organizations by contacting support@madhyamas.ai. The old license is revoked and a new one is issued.

Troubleshooting

ProblemSolution
License not foundCheck that --license-file points to a valid file
Invalid license signatureThe license file was modified or corrupted. Re-download from the portal.
License expiredRenew the license at madhyamas.ai
Seat limit exceededStop an unused instance or upgrade your plan
Instance ID mismatchSet --instance-id to match the value in the license, or remove the binding
License banner in UILicense is missing, expired, or invalid. Check the License panel for details.

See Also

Released under the MIT OR Apache-2.0 License.