docsParity
FailproofAI/failproofai1,107TypeScript

vs https://docs.befailproof.ai/introduction

The documentation is high-level and marketing-focused, covering concepts like built-in policies, custom policies, and the dashboard. However, it does not document most of the public API surface exported from the code (custom hook management, audit functions, detectors, adapters, archetypes, and lock management). For developers trying to use the library programmatically via npm, the docs provide almost no concrete API guidance, only CLI usage.

3 high5 medium2 low
Open issue with all findings ↗
12
Files analyzed
42
API symbols
1
Doc pages
44.7s
Analyzed in
7%
API coverage: Poorly documented
3 of 42 exported symbols mentioned in docs
12 source files inspected · claude-haiku-4-5-20251001 · Aug 13, 2026

10 mismatches found

01

Custom hooks registry API undocumented

src/index.ts

high
In the code
export { customPolicies } from "./hooks/custom-hooks-registry"
export { getCustomHooks } from "./hooks/custom-hooks-registry"
export { clearCustomHooks } from "./hooks/custom-hooks-registry"
In the docs
(not documented)

The code exports three functions for managing custom hooks (customPolicies, getCustomHooks, clearCustomHooks), but the documentation does not mention these APIs at all. Developers trying to programmatically manage custom policies via the npm package have no guidance.

Suggested fix
Add a section to the documentation describing the custom hook registry API with examples of how to call customPolicies(), getCustomHooks(), and clearCustomHooks(). Include parameter types and return values.
02

Audit API undocumented

src/audit/index.ts

high
In the code
export async function runAudit(opts: RunAuditOptions = {}): Promise<AuditResult>
In the docs
(not documented)

The code exports runAudit() as a public async function, but the docs do not mention this API. Developers who want to run audits programmatically have no documentation on how to use it or what options/results are available.

Suggested fix
Document the runAudit() function with its options parameter type (RunAuditOptions) and return type (AuditResult). Provide code examples showing how to call it and handle the audit result.
03

PolicyContext and PolicyResult types not documented

src/index.ts

high
In the code
export { PolicyContext } from "./hooks/policy-types"
export { PolicyResult } from "./hooks/policy-types"
export { CustomHook } from "./hooks/policy-types"
export { PolicyDecision } from "./hooks/policy-types"
export { PolicyFunction } from "./hooks/policy-types"
In the docs
(not documented)

The code exports five core type definitions used for custom policies (PolicyContext, PolicyResult, CustomHook, PolicyDecision, PolicyFunction), but the docs do not document any of these types. Developers writing custom policies need to understand these types but have no guidance.

Suggested fix
Document all five exported types from policy-types.ts with their properties, usage context, and examples. This is essential for the custom policies feature mentioned in the docs.
04

Audit detectors API undocumented

src/audit/detectors/index.ts

medium
In the code
export const AUDIT_DETECTORS: Detector[]
export function getDetectorByName(name: string): Detector | undefined
In the docs
(not documented)

The code exports AUDIT_DETECTORS and getDetectorByName(), enabling programmatic access to detection logic, but the docs do not mention these APIs at all.

Suggested fix
Add documentation describing the detector API, including what AUDIT_DETECTORS contains, how to use getDetectorByName(), and examples of the Detector interface structure.
05

CLI adapters API undocumented

src/audit/cli-adapters/index.ts

medium
In the code
export { ListOpts }
export interface CliAdapter { cli: IntegrationType; listTranscripts: (opts?: ListOpts) => Promise<TranscriptMetadata[]>; streamEvents: (meta: TranscriptMetadata) => Promise<NormalizedToolEvent[]>; }
export const ADAPTERS: Record<IntegrationType, CliAdapter>
export function getAdapter(cli: IntegrationType): CliAdapter
In the docs
(not documented)

The code exports CliAdapter interface, ADAPTERS, and getAdapter() function, providing a way to access integration-specific adapters, but the docs provide no guidance on this API.

Suggested fix
Document the CliAdapter interface, the ADAPTERS registry, and the getAdapter() function with examples of how to list transcripts and stream events for different integrations.
06

Archetype classification API undocumented

src/audit/archetypes.ts

medium
In the code
export function pickArchetypeVariant(key: ArchetypeKey, seed: string): ResolvedArchetype
export function classifyAgent(result: AuditResult, seed = ""): Classification
export const ARCHETYPES: Record<ArchetypeKey, Archetype>
export const SIGILS: Record<ArchetypeKey, string[]>
In the docs
(not documented)

The code exports archetype-related APIs (pickArchetypeVariant, classifyAgent, ARCHETYPES, SIGILS) for agent behavior classification, but the documentation does not mention these functions or their purpose. A developer trying to use this feature programmatically would have no guidance.

Suggested fix
Document the archetype system with examples of how classifyAgent() works, what the 8 archetypes represent, and how to use pickArchetypeVariant() to customize output. Include the ArchetypeKey union type and Classification interface.
07

Audit lock API undocumented

src/audit/audit-lock.ts

medium
In the code
export function acquireAuditLock(source: AuditLockSource, now?: number): AcquireAuditLockResult
export function readAuditLock(): AuditLockInfo | null
export function readActiveAuditLock(now?: number): AuditLockInfo | null
export const AUDIT_LOCK_MAX_AGE_MS: number
export type AuditLockSource = "cli" | "scheduled" | "dashboard" | "onboarding"
export interface AuditLockInfo { pid: number; startedAt: number; source: AuditLockSource; }
export interface AuditLockHandle { info: AuditLockInfo; release(): void; }
export type AcquireAuditLockResult = { ok: true; lock: AuditLockHandle } | { ok: false; heldBy: AuditLockInfo | null }
In the docs
(not documented)

The code exports a complete audit locking system (acquireAuditLock, readAuditLock, readActiveAuditLock, and supporting types), but the documentation does not mention this API. Developers needing to coordinate concurrent audit runs have no guidance.

Suggested fix
Document the audit lock API with explanations of when and how to use acquireAuditLock(), how to check lock status, and how the lock handles concurrent access. Include type definitions and error handling examples.
08

Policy helper functions lack detailed documentation

src/index.ts

medium
In the code
export { allow } from "./hooks/policy-helpers"
export { deny } from "./hooks/policy-helpers"
export { instruct } from "./hooks/policy-helpers"
In the docs
**Custom policies** \
\
Write your own rules in JavaScript with a simple allow / deny / instruct API.

While the docs mention allow/deny/instruct in the quick overview, there is no detailed documentation of these functions, their signatures, parameters, or return types. A developer trying to write a custom policy would need to reverse-engineer the API from examples.

Suggested fix
Add a dedicated section in the custom policies documentation with the function signatures, parameter types, return types, and code examples for allow(), deny(), and instruct(). Include what PolicyContext and PolicyResult are and how to use them.
09

CliError class undocumented

src/cli-error.ts

low
In the code
export class CliError extends Error {
  exitCode: 1 | 2
  constructor(message: string, exitCode: 1 | 2 = 1)
}
In the docs
(not documented)

The code exports a CliError class for structured error handling, but the docs do not mention it. Developers building CLI tools or integrations may need this for proper error handling and exit codes.

Suggested fix
Document CliError with examples of how to instantiate it with exit codes and how to catch/handle it in CLI contexts.
10

PostHog telemetry constants undocumented

src/posthog-key.ts

low
In the code
export const POSTHOG_API_KEY
export const POSTHOG_PRODUCT
In the docs
(not documented)

The code exports POSTHOG_API_KEY and POSTHOG_PRODUCT constants used for telemetry, but the docs do not mention these or explain the telemetry behavior. The introduction does state 'Transcripts and policy evaluation stay on your machine. Data is sent only when you explicitly use an online feature' but does not detail what data is sent or how PostHog is used.

Suggested fix
Either document these constants as part of the public API (if they are intended for external use) or remove them from the public export. If kept, clarify in the telemetry/privacy section of the docs what PostHog data collection occurs and why.