Skip to main content

Zero-latency App-Layer WAF, Automated SRE Logging, and AI Rescue Engine.

Project description

Seal Python SDK Setup Documentation

1. Quick Start

Step 1: Install the SDK

pip install desicon-seal

Step 2: Initialize Seal & Add ASGI Middleware

For modern Python frameworks (FastAPI, Starlette, Django 3.0+), you can easily add the Edge-equivalent WAF to your application using the SealASGIMiddleware.

from fastapi import FastAPI
from seal import seal

app = FastAPI()

# 1. Initialize Telemetry & SRE
seal.init(
    api_key="seal_live_xxxx",   # From your dashboard
    app_name="My FastAPI App",
    environment="production"
)

# 2. Add the WAF Middleware to protect your API
app.add_middleware(seal.asgi_middleware())

2. Configuration Options

Python Parameter Node.js / Browser Parameter Type Description
api_key apiKey string Your project API key from the dashboard.
app_name appName string A human-readable name for your application.
environment environment string Current deployment environment: 'production', 'staging', or 'development'.
rescue_engine rescueEngine boolean Set to true to enable automated AI hotfix generation and patching.
level level string fatal

3. The Sensitivity Dialer

The Sensitivity Dialer controls how much noise Seal generates. Set it in two places:

  1. SDK: Set level in seal.init().
  2. Dashboard: Override per-project in Settings. Server enforces it.

Levels:

  • fatal (Low): Only unhandled crashes.
    seal.init({ level: "fatal" });
    
  • error (Medium): Caught exceptions + fatal.
    seal.init({ level: "error" });
    
  • warning (High): Everything. Good luck.
    seal.init({ level: "warning" });
    

4. Seal Rescue Engine

When the Rescue Engine is enabled (via Project Settings), Seal doesn't just send you an alert. It instructs your connected AI to generate a functional, sandboxed JavaScript fix that addresses the logical error. The fix is minified and encrypted before leaving the server—only your SDK (holding the same API key) can decrypt and execute it.

Each fix is uniquely identified (seal_fix_xxxx) and location-aware: the same error type at two different code locations gets two separate fixes. If a fix fails to apply, the SDK automatically reports the failure, the bad fix is scrubbed server-side, and a fresh fix is generated on the next occurrence. No stale fixes, no fix-the-fix loops.

    1. Enable 'Seal Rescue Engine' in your Project settings.
    1. Ensure you have an AI Provider configured in settings.
    1. When an unhandled error occurs, Seal generates an encrypted rescue fix.
    1. The SDK decrypts and applies this fix in memory—invisible to network inspectors, DevTools, and MITM proxies.

Stack Compatibility & Frameworks

The Rescue Engine dynamically patches JavaScript bugs in the browser, but it is fully compatible with ANY backend stack.

Server-Rendered Apps: Even if your backend is Python or PHP, your users still interact with HTML/JS in the browser. Drop the Seal JS SDK into your Jinja2, Django, or Blade templates. The Rescue Engine will catch and hotfix frontend JavaScript bugs seamlessly.

<!DOCTYPE html>
<html>
<head>
    <!-- Drop Seal before your other scripts -->
    <script src="https://cdn.jsdelivr.net/gh/Desicon-AI/seal-cdn@main/seal.js"></script>
    <script>
      Seal.init({
        apiKey: "{{ SEAL_API_KEY }}", // Passed from backend
        appName: "My Web App",
        rescueEngine: true
      });
    </script>
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

5. AI Personas

Seal speaks in three voices. Choose the one that fits your team culture. Personas are set at the Organization level and apply to all projects.

Seal (Sarcastic & Mean) — All Plans

The default. Seal roasts your code, insults your variable names, and grudgingly tells you how to fix it. Perfect for teams with thick skin and a sense of humor.

Example: "You passed a string to parseInt and expected magic? Cast your variables, you absolute menace. Here's the fix, don't make me say it twice."

Friendly (Supportive & Positive) — Pro / Team

A warm, encouraging senior dev who wants you to know it's going to be okay. Uses emojis. Celebrates small wins. Great for junior-heavy teams or if HR keeps filing complaints.

Example: "Hey! 👋 Looks like a small type mismatch slipped through — happens to everyone! Here's a quick fix. You're doing great! 🎉"

Professional (Strategic & Objective) — Pro / Team

An enterprise-grade SRE delivering strictly factual root cause analysis and remediation steps. No jokes, no fluff. Designed for large organizations, regulated industries, and teams that need clean audit trails.

Example: "Root Cause: Type coercion failure in paymentAPI.submit(). Remediation: Validate input type before invocation. Patch recommended."

How to configure

All future error analyses across every project in your organization will use the new voice.

1. Dashboard → Settings → Organization Persona
2. Select your preferred persona and click Save

7. Integrations

Bring Your Own AI (BYOAI)

Seal works out of the box for free using our massive database of hand-crafted roasts. But if you want AI to suggest actual code fixes, connect any AI provider (OpenAI, Anthropic, Groq, Ollama). We never markup token usage. If your API goes down, Seal seamlessly falls back to standard mode.

Dashboard → Settings → Select Provider → Paste Key

Slack Webhooks

Seal sends rich, formatted alerts directly to your Slack channels with full stack traces, AI analysis, and severity badges.

1. Dashboard → Settings → Connect Slack
2. Slack → Channel → Settings → Integrations → Add Seal

Discord Webhooks

Same rich alerts, same brutal honesty — delivered to your Discord server. Perfect for indie devs and open source projects.

Dashboard → Settings → Connect Discord (automatic)

8. The 'Not My Fault' Engine

Our 'Not My Fault' engine analyzes stack traces. If a crash originated from an external package, we will notify the maintainer of the issue so they can work on it. But we are smart about it. If we notice that the error was caused by missing parameters or incorrect usage by the developer, rather than sending the maintainer a ticket, we notify the developer of the correct use.

For Maintainers

Sign up for a free Seal account to claim and track your public npm/pip packages. You only need a paid subscription if you want to use Seal to monitor your own applications.

For Developers

Enable this feature within your project settings so that genuine errors from external packages are automatically sent to the maintainers.

Dashboard → Settings → Enable 'Not My Fault'

9. Sandbox Testing

Use your Sandbox project to test Seal's ingestion and AI analysis without triggering webhooks or skewing your live analytics. Sandbox API keys always start with sandbox_ and can be found in your Dashboard. You can also test everything interactively in the Playground.

from seal_ai import seal

seal.init(
    api_key="sandbox_YOUR_KEY",
    app_name="Test App",
    environment="development",
    endpoint="https://sealengine.desicon.ai/api/v1/sandbox/ingest"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

desicon_seal-1.0.4.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

desicon_seal-1.0.4-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file desicon_seal-1.0.4.tar.gz.

File metadata

  • Download URL: desicon_seal-1.0.4.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for desicon_seal-1.0.4.tar.gz
Algorithm Hash digest
SHA256 aba864ddc2141950ecf7888ac2661e4d1ba39dbeacc16fc1c8f14bbd51ff3d35
MD5 9819a687deb46ff381c2a5ce1a63f49d
BLAKE2b-256 8ada2de07bd382dc05f2e46712659a2f47e721f049b074aa5cf53fcbf8a5de48

See more details on using hashes here.

File details

Details for the file desicon_seal-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: desicon_seal-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for desicon_seal-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4183da90b657a7e8dfd12a665014e924525ab8edcc427a4f3c787bffe40ec5d5
MD5 f022deab2f569a004a19683f2fa6f052
BLAKE2b-256 86ede7488751c9644dbeec68019a2140e58f8f76c53ffbd906dbc56e814a5fe8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page