-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path__init__.py
More file actions
70 lines (56 loc) · 1.86 KB
/
Copy path__init__.py
File metadata and controls
70 lines (56 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""Audit sink framework for governance events.
This module provides a pluggable audit system that supports multiple
output destinations (sinks) for governance events. Events are emitted
to all registered sinks, allowing flexible audit trail configuration.
Usage::
from uipath.runtime.governance.audit import get_audit_manager, AuditEvent
# Get the global audit manager
manager = get_audit_manager()
# Emit an event (goes to all registered sinks)
manager.emit(AuditEvent(
event_type="rule_evaluation",
trace_id="abc-123",
agent_name="my-agent",
data={"rule_id": "ASI-01", "matched": True},
))
# Register a custom sink
manager.register_sink(MyCustomSink())
Built-in sinks:
- :class:`TracesAuditSink` – OpenTelemetry spans for Orchestrator Traces UI
- :class:`ConsoleAuditSink` – stderr output for debugging
Sink registration:
- The ``traces`` sink (OpenTelemetry spans → Orchestrator audit UI) is
**platform-mandated** and always registered. It cannot be disabled by
a developer-side env var — governance is platform-owned.
- The ``console`` sink is a developer aid for local debugging and is
opt-in via env var.
Environment variables (developer-facing, console only):
- ``UIPATH_AUDIT_VERBOSE`` – verbose console output.
- ``UIPATH_GOVERNANCE_CONSOLE_LOG`` – enable the console sink.
"""
from .base import (
AuditEvent,
AuditManager,
AuditSink,
EventType,
get_audit_manager,
reset_audit_manager,
)
from .console import ConsoleAuditSink
from .factory import create_sink
from .traces import TracesAuditSink
__all__ = [
# Core classes
"AuditEvent",
"AuditManager",
"AuditSink",
"EventType",
# Global manager
"get_audit_manager",
"reset_audit_manager",
# Factory
"create_sink",
# Built-in sinks
"ConsoleAuditSink",
"TracesAuditSink",
]