jsonfirst-ai-agents
v1.0.0
Published
JSONFIRST governance layer for AI agents — parse, validate and route natural language intent before any agent executes an action
Maintainers
Readme
jsonfirst-ai-agents
AI agents fail when they act on ambiguous input.
JSONFIRST adds a structured intent governance layer before any agent executes — parse, validate, and route natural language deterministically.
Intent → Govern → Execute.
JSONFIRST helps build reliable AI agents by converting natural language into structured JSON intent.
User input (any language, any format)
↓
JSONFIRST (parse + govern)
↓
JDON: { action, object, confidence, domain }
↓
canExecute() → true/false
↓
Agent execution (safe)Quick Example
const { parseIntent, canExecute, getAction } = require('jsonfirst-ai-agents');
const jdon = await parseIntent(
"cancel the premium subscription for user 42",
process.env.JSONFIRST_API_KEY
);
if (canExecute(jdon, 0.85)) {
const action = getAction(jdon); // → "cancel"
await agents[action].run(jdon);
} else {
console.log('Low confidence — requesting clarification');
}Why add a governance layer
Without JSONFIRST:
User: "remove john" → agent deletes user → irreversibleWith JSONFIRST:
User: "remove john" → JDON: { action: "delete", confidence: 0.91 }
→ canExecute(jdon, 0.9) → true → agent deletes safelyInstallation
npm install jsonfirst-ai-agentsGet your API key at jsonfirst.com → Dashboard → API Console.
API
const { parseIntent, canExecute, getAction } = require('jsonfirst-ai-agents');| Function | Description |
|---|---|
| parseIntent(text, apiKey, opts) | Returns structured JDON |
| canExecute(jdon, threshold) | Returns true if confidence ≥ threshold (default: 0.8) |
| getAction(jdon) | Returns normalized action string |
Governance Modes
| Mode | Use case |
|---|---|
| ANTI_CREDIT_WASTE_V2 | Default — fast, token-efficient |
| MAX_PERFORMANCE | Maximum accuracy for critical actions |
| STRICT_PROTOCOL | Enforces full JSONFIRST compliance |
| GUARDIAN_MODE | Enhanced safety for destructive actions |
Links
License
MIT © JSONFIRST
