Series 3 — Part 5 of 6

Building your own product adapter on the behavioral AI platform requires four decisions: which engines to use, how to weight them, how to build the governance wrapper for your domain, and how to achieve 75/75 test coverage. This article walks through all four.

Step 1: Choose Your Engines

Start with the minimum viable engine set. Ask: what behavioral dimension matters most for this product's decision? Pick the 3–5 engines that cover it. Add engines only when you have a specific, testable reason.

A good rule of thumb: if removing an engine does not change the domain score by more than 5% in 90% of test cases, it should not be in the adapter.

Step 2: Weight the Signals

Weights are policy decisions. Start with equal weights and run the adapter against historical data with known outcomes. Use the empirical validation engine to identify which signals are most predictive in your domain. Adjust weights accordingly, document the rationale, and version-control the weight file separately from the adapter code.

Step 3: Build the Governance Wrapper

// Every adapter needs its own domain-specific safe language extensions
const MY_DOMAIN_LANGUAGE_MAP = {
  ...CORE_SAFE_LANGUAGE_MAP,  // inherit the core map
  'high_friction_detected': 'elevated process complexity indicators',
  'deadline_manipulation':  'deadline-related communication patterns noted',
};

const MY_DOMAIN_HARM_GATES = [
  ...CORE_HARM_GATES,         // inherit core gates
  { test: o => o.domain === 'myDomain' && o.score > 0.9,
    action: 'require_human_review',
    reason: 'high-consequence-my-domain-output' },
];

75/75 Test Coverage

75% line coverage and 75% branch coverage are the minimums. For adapters, additionally require:

  • A test for every safe-language map entry (confirm the translation fires correctly)
  • A test for every harm gate (confirm it triggers on the correct input)
  • An integration test for the full pipeline: input → engines → governance → output
  • A test for the governance bypass guard (confirm that direct engine calls are not exposed through the adapter)