Examples Guide (Recommended Examples)

To help you quickly understand and adopt the Contexa platform, we have selected 4 core scenarios from our 18+ examples to guide your integration journey.

Contexa is designed to be highly practical, providing real-world templates for integrating Zero Trust security and AI decision-making. We highly recommend exploring these codebase examples in the following order.


1. Essential Start: Quickstart Example

Repository Path: contexa-example-quickstart

Key Takeaways & Learning Points

This is the perfect entry point for developers integrating the Contexa platform into their Spring Boot application for the first time.

  • Basic Dependency Wiring: Learn how to bind the library using spring-boot-starter-contexa with a minimal build configuration.
  • Basic Properties Configuration: Configure database connections and essential settings like contexa.infrastructure.mode.
  • Testing Shadow Mode: Learn the fundamentals of **Shadow Mode**, which allows you to observe traffic and detect anomalies without enforcing blocking rules.

2. Core of AI Security Decision: AI Pipeline Example

Repository Path: contexa-example-ai-pipeline

Key Takeaways & Learning Points

This is the core technical showcase that demonstrates why Contexa is far more flexible and powerful than traditional static, rule-based security frameworks.

  • Security Decision Prompt Pipeline: Understand the real-time pipeline that collects authentication/authorization evidence, standardizes it into a CanonicalSecurityContext, and incorporates RAG knowledge to prompt the LLM.
  • Hierarchical Decision Making (Cortex L1/L2): Experience the tiered LLM orchestration mechanism, executing instantaneous decisions (L1) and deep analytical reviews (L2) dynamically.

3. Practical Identity Security: Identity MFA Example

Repository Path: contexa-example-identity-mfa

Key Takeaways & Learning Points

A practical blueprint for implementing continuous identity verification and Step-up Authentication in a Zero Trust environment.

  • Passkey & OTP Integration: Learn how to easily bind modern, passwordless Passkey and One-Time Password authentication within Spring Security.
  • Adaptive MFA: Understand the real-world pattern of dynamically escalating authentication levels based on the contextual risk of incoming requests.

4. Real-World Migration: Legacy System Integration Example

Repository Path: contexa-example-legacy-system

Key Takeaways & Learning Points

A pragmatic migration scenario showing how to incrementally inject the Contexa security layer **without dismantling or rebuilding an existing enterprise system**.

  • Using Contexa Bridge: Learn how to safely attach the Contexa verification bridge without breaking existing authentication providers.
  • Zero-Downtime Gradual Adoption: Study how the legacy database and authentication session pool coexist and synchronize with the isolated Contexa datasource.