Hooks
Hooks receive events from external systems and trigger approved automations or agent flows. Use them for event-driven integration, not as unauthenticated general execution endpoints. This entry is typically visible only when enterprise hooks are enabled for the deployment.
Management Boundary
Concepts
Common Hook Points
The exact payload and response schema belongs to the hook point contract. Do not assume two hook points accept the same fields just because both use HTTP POST.
Before Configuration
- Define the event source, event types, and allowed actions.
- Add signature validation and replay protection for each hook.
- Plan retry, idempotency, and alerting behavior.
- Decide which hook point is allowed to affect the pipeline and which should only observe or notify.
- Choose the fail strategy and timeout before connecting the endpoint.
- Prepare an endpoint that returns valid JSON and a
2xxstatus for accepted requests. - Store any endpoint API key in a managed secret store and rotate it with the owning service.
Connect a Hook
- Open the AIvis admin area and go to the hooks page.
- Select the hook point you want to connect.
- Provide a display name that includes the system, environment, and purpose.
- Enter the HTTPS endpoint URL. Do not use a public test endpoint for production data.
- Configure authentication, timeout, and fail strategy.
- Save the hook only after the endpoint passes the connection test.
Managing Hooks
Health and Failure Handling
Monitor hook health after registration. A healthy endpoint is reachable and has no recent execution failures. A degraded endpoint may still be reachable but should be treated as an active reliability or policy risk. A lost connection means AIvis cannot reach the endpoint and will follow the configured fail strategy.
For hard-fail hooks, test the user or indexing experience that appears when the hook rejects, times out, or returns invalid JSON. For soft-fail hooks, confirm the main pipeline continues while the failure is still visible in logs and alerts.
Verification
- Validate the path with a legitimate event.
- Test missing signatures, wrong signatures, and repeated events.
- Confirm query history can trace event handling results.
- Test timeout behavior and invalid JSON responses.
- Confirm hard-fail hooks block the intended action and soft-fail hooks continue safely.
- Confirm the endpoint does not log raw secrets, full credentials, or unnecessary user content.
- Confirm request IDs, event IDs, and rejection reasons can be joined across AIvis logs and the endpoint logs.
Production Checklist
- Each hook has one owner, one environment, and one explicit hook point.
- Endpoint access is restricted by HTTPS, authentication, and network controls.
- The endpoint is idempotent for retries and duplicate events.
- Blocking hooks have user-facing or operator-facing failure messages that explain the next step without leaking policy internals.
- Hook decisions are auditable, including pass-through, rewrite, rejection, timeout, and endpoint failure outcomes.