Configuration Properties

Complete reference for all Contexa configuration properties. All properties are set in application.yml and bound through Spring Boot's @ConfigurationProperties mechanism. Properties are organized into 5 categories below.

Configuration Categories

Contexa provides 27 @ConfigurationProperties classes across all modules. Select a category to view the full property reference.

Essential Properties

The most important properties to configure when starting with Contexa:

Property Default Description
contexa.enabled true Master switch for the entire Contexa platform
contexa.infrastructure.mode STANDALONE STANDALONE (in-memory) or DISTRIBUTED (Redis + Kafka)
contexa.llm.enabled true Enable LLM integration for AI-driven security decisions
security.zerotrust.enabled true Enable zero-trust continuous verification
spring.auth.state-type OAUTH2 State management: SESSION or OAUTH2. Can be omitted — defaults work for most setups.
contexa.llm.chat-model-priority Contexa LLM provider priority (e.g., ollama,anthropic,openai). This is a Contexa-specific property, not part of Spring AI.

Minimal Configuration

A minimal application.yml to get started with Contexa in standalone mode:

YAML
contexa:
  enabled: true
  infrastructure:
    mode: standalone
  llm:
    enabled: true
    chat-model-priority: ollama,anthropic,openai
    chat:
      ollama:
        base-url: http://127.0.0.1:11434
        model: qwen3.5:9b
  rag:
    enabled: true

security:
  zerotrust:
    enabled: true

spring:
  auth:
    state-type: SESSION
  ai:
    security:
      layer1:
        model: qwen2.5:14b
      layer2:
        model: exaone3.5:latest

Contexa Core Properties

Top-level properties under the contexa prefix, bound to ContexaProperties.

Property Type Default Description
contexa
.enabled boolean true Master switch to enable or disable the entire Contexa platform
.infrastructure.mode enum STANDALONE Infrastructure mode: STANDALONE (in-memory) or DISTRIBUTED (Redis, Kafka)
.infrastructure.redis.enabled boolean true Enable Redis integration for distributed caching
.enterprise.enabled boolean false Enable enterprise-only integrations when the runtime provides them
.infrastructure.kafka.enabled boolean true Enable Kafka integration for event streaming (distributed mode)
.infrastructure.observability.enabled boolean true Enable observability infrastructure
.infrastructure.observability.open-telemetry-enabled boolean true Enable OpenTelemetry integration for distributed tracing

LLM Properties

Property Type Default Description
contexa.llm
.enabledbooleantrueEnable LLM integration for AI-driven security decisions
.chat-model-priorityStringollama,anthropic,openaiPreferred chat provider order used by Contexa model resolution
.advisor-enabledbooleantrueEnable the AI advisor chain
.embedding-model-priorityStringollama,openaiPreferred embedding provider order used by Contexa model resolution
.chat.ollama.base-urlString""Dedicated Ollama chat runtime URL required when Ollama chat is enabled
.chat.ollama.modelString""Ollama chat model name used by the Contexa chat runtime
.chat.ollama.keep-aliveString""Optional keep-alive hint passed to the Ollama chat runtime
.embedding.ollama.dedicated-runtime-enabledbooleanfalseUse a dedicated Ollama embedding runtime instead of the shared chat runtime
.embedding.ollama.base-urlString""Dedicated Ollama embedding runtime URL when dedicated-runtime-enabled is true
.embedding.ollama.modelString""Embedding model name for the Ollama embedding runtime

Spring AI Tiered and External Provider Configuration

Contexa reads tier selection from spring.ai.security*. External Anthropic and OpenAI providers use standard spring.ai.* properties. Ollama runtime selection is configured under contexa.llm.*, not spring.ai.ollama.*.

Property Type Description
spring.ai
.security.layer1.modelStringTier-1 model name used for the first analysis pass
.security.layer2.modelStringTier-2 model name used for deep analysis and escalation
.security.tiered.prompt-compression.enabledbooleanEnable runtime prompt compression for tiered execution
.security.tiered.layer1.timeout.total-mslongTotal timeout budget for the tier-1 execution path
.security.tiered.layer2.timeout-mslongTotal timeout budget for the tier-2 execution path
.anthropic.api-keyStringAnthropic API key for the standard Spring AI Anthropic client
.openai.api-keyStringOpenAI API key for the standard Spring AI OpenAI client
.openai.base-urlStringOverride the OpenAI API base URL when a proxy or compatible endpoint is used

Vector Store Properties

Property Type Default Description
contexa.rag
.enabledbooleantrueEnable the RAG subsystem inside Contexa
.defaults.top-kint10Default number of retrieved documents for general retrieval
.defaults.similarity-thresholddouble0.7Default similarity threshold for general retrieval
.risk.top-kint50Number of retrieved documents for risk-oriented retrieval
.risk.similarity-thresholddouble0.8Similarity threshold for risk-oriented retrieval
.etl.vector-table-nameStringvector_storeLogical vector table name used by Contexa ETL jobs
.etl.chunk-sizeint500Document chunk size used during vector ETL
.etl.chunk-overlapint50Chunk overlap used during vector ETL
spring.ai.vectorstore.pgvector
.dimensionsint1024Embedding dimension used by the pgvector store
.batch-sizeint100Batch size used when storing vectors
.top-kint100Default retrieval limit inside the pgvector store adapter
.similarity-thresholddouble0.5Minimum similarity threshold enforced by the pgvector adapter
.search-timeout-mslong10000Search timeout budget for pgvector queries
.store-timeout-mslong10000Store timeout budget for pgvector writes
.document.chunk-sizeint1000Chunk size used when preparing source documents for storage
.document.chunk-overlapint200Chunk overlap used when preparing source documents for storage

Zero Trust Properties

Properties under security.zerotrust, bound to SecurityZeroTrustProperties.

Property Type Default Description
security.zerotrust
.enabled boolean true Enable Zero Trust evaluation engine
.threat.initial double 0.3 Initial threat score assigned to new sessions
.cache.ttl-hours int 24 Trust evaluation cache TTL in hours
.cache.session-ttl-minutes int 30 Session cache TTL in minutes
.cache.invalidated-ttl-minutes int 60 Invalidated session cache TTL in minutes
.redis.timeout int 5 Redis operation timeout in seconds
.redis.update-interval-seconds int 30 Interval for syncing trust scores to Redis
.session.tracking-enabled boolean true Enable AI-driven session tracking

HCAD Properties

Hierarchical Context-Aware Detection properties under hcad, bound to HcadProperties.

Property Type Default Description
hcad
.enabledbooleantrueEnable the HCAD anomaly detection engine
.filter-orderint100Order of the HCAD filter in the security filter chain
.similarity.hot-path-thresholddouble0.7Similarity threshold used by the hot path evaluation stage
.baseline.learning.enabledbooleantrueEnable continuous baseline learning
.baseline.bootstrap.initial-samplesint10Minimum bootstrap sample count before the initial baseline is accepted
.baseline.statistical.min-samplesint20Minimum sample count for statistical baseline updates

Autonomous Security Properties

Property Type Default Description
contexa.autonomous
.enabledbooleantrueEnable autonomous security response processing
.event-timeoutlong30000Timeout for autonomous event processing in milliseconds

Session Security Properties

Properties under security.session, bound to SecuritySessionProperties.

Property Type Default Description
security.session
.cookie.name String SESSION Session cookie name
.header.name String X-Auth-Token Session header name for token-based sessions
.bearer.enabled boolean true Enable bearer token session resolution

Full Configuration Example

A complete application.yml showing all major configuration sections:

YAML
contexa:
  enabled: true
  infrastructure:
    mode: standalone
    redis:
      enabled: true
    kafka:
      enabled: false
    observability:
      enabled: true
      open-telemetry-enabled: true

  hcad:
    enabled: true
    similarity:
      hot-path-threshold: 0.7
    baseline:
      min-samples: 10
      cache-ttl: 3600

  llm:
    enabled: true
    advisor-enabled: true
    chat-model-priority: ollama,anthropic,openai
    embedding-model-priority: ollama,openai
    chat:
      ollama:
        base-url: http://127.0.0.1:11434
        model: qwen3.5:9b
        keep-alive: 24h
    embedding:
      ollama:
        dedicated-runtime-enabled: false
        model: mxbai-embed-large

  rag:
    enabled: true
    defaults:
      top-k: 10
      similarity-threshold: 0.7
    etl:
      vector-table-name: vector_store
      chunk-size: 500
      chunk-overlap: 50

  autonomous:
    enabled: true
    event-timeout: 30000

hcad:
  enabled: true
  filter-order: 100
  baseline:
    learning:
      enabled: true

security:
  zerotrust:
    enabled: true
    mode: ENFORCE
    threat:
      initial: 0.3
    cache:
      ttl-hours: 24
      session-ttl-minutes: 30
    redis:
      timeout: 5
      update-interval-seconds: 30

  session:
    cookie:
      name: SESSION
    header:
      name: X-Auth-Token
    bearer:
      enabled: true

spring:
  auth:
    state-type: SESSION
  ai:
    security:
      layer1:
        model: qwen2.5:14b
      layer2:
        model: exaone3.5:latest
      tiered:
        prompt-compression:
          enabled: true
    anthropic:
      api-key: ${ANTHROPIC_API_KEY:}
    openai:
      api-key: ${OPENAI_API_KEY:}
    vectorstore:
      pgvector:
        dimensions: 1024
        batch-size: 100
        top-k: 100
        similarity-threshold: 0.5
        document:
          chunk-size: 1000
          chunk-overlap: 200

ContexaProperties Quick Reference

Complete list of high-signal contexa.* properties from ContexaProperties. Each section links to the detailed sub-page.

Master Switches

PropertyTypeDefaultDescription
contexa.enabledbooleantrueMaster switch for the entire Contexa platform.

HCAD (Behavioral Analysis)

PropertyTypeDefaultDescription
contexa.hcad.enabledbooleantrueEnable the Contexa-side HCAD toggle.
contexa.hcad.similarity.hot-path-thresholddouble0.7Hot path similarity threshold exposed through ContexaProperties.
contexa.hcad.baseline.min-samplesint10Minimum baseline sample count in the Contexa wrapper properties.
contexa.hcad.baseline.cache-ttlint3600Baseline cache TTL in seconds in the Contexa wrapper properties.

LLM (Language Model)

PropertyTypeDefaultDescription
contexa.llm.enabledbooleantrueEnable LLM integration.
contexa.llm.advisor-enabledbooleantrueEnable the advisor chain.
contexa.llm.chat-model-priorityStringollama,anthropic,openaiChat model provider priority order.
contexa.llm.embedding-model-priorityStringollama,openaiEmbedding model provider priority order.
contexa.llm.chat.ollama.base-urlString""Ollama chat runtime URL.
contexa.llm.embedding.ollama.dedicated-runtime-enabledbooleanfalseEnable a dedicated embedding runtime.

RAG (Retrieval-Augmented Generation)

PropertyTypeDefaultDescription
contexa.rag.enabledbooleantrueEnable the RAG pipeline wrapper.
contexa.rag.defaults.top-kint10Default retrieval size.
contexa.rag.defaults.similarity-thresholddouble0.7Default similarity threshold.
contexa.rag.etl.vector-table-nameStringvector_storeLogical vector table name for ETL output.

Autonomous Agent

PropertyTypeDefaultDescription
contexa.autonomous.enabledbooleantrueEnable autonomous security processing.
contexa.autonomous.event-timeoutlong30000Event processing timeout in milliseconds.

Infrastructure

PropertyTypeDefaultDescription
contexa.infrastructure.modeenumSTANDALONESTANDALONE (in-memory) or DISTRIBUTED (Redis + Kafka).
contexa.infrastructure.redis.enabledbooleantrueEnable Redis for distributed caching.
contexa.infrastructure.kafka.enabledbooleantrueEnable Kafka for event streaming.
contexa.infrastructure.observability.enabledbooleantrueEnable observability.
contexa.infrastructure.observability.open-telemetry-enabledbooleantrueEnable OpenTelemetry integration.
contexa.enterprise.enabledbooleanfalseEnable enterprise-only integrations when the runtime provides them.

SaaS Integration (Enterprise)

PropertyTypeDefaultDescription
contexa.saas.enabledbooleanfalseEnable SaaS integration with Contexa Cloud.
contexa.saas.endpointStringhttps://saas.ctxa.aiSaaS platform endpoint URL.
contexa.saas.outbox-batch-sizeint50Outbox batch size for event forwarding.
contexa.saas.max-retry-attemptsint10Maximum retry attempts for failed event delivery.
contexa.saas.dispatch-interval-mslong30000Dispatch interval for SaaS forwarding jobs.