reskpoints 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .venv/
8
+ .env
9
+ *.ruff_cache/
10
+ .mypy_cache/
11
+ .pytest_cache/
12
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 RESK Security
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: reskpoints
3
+ Version: 0.1.0
4
+ Summary: Agent Action Logging Platform — log all AI/LLM agent actions to any platform
5
+ Project-URL: Homepage, https://github.com/Resk-Security/ReskPoints
6
+ Project-URL: Repository, https://github.com/Resk-Security/ReskPoints
7
+ Author: RESK Security
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: agent,ai,llm,logging,monitoring,observability
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Classifier: Topic :: System :: Monitoring
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: httpx>=0.27.0
19
+ Requires-Dist: pydantic>=2.0.0
20
+ Requires-Dist: python-dotenv>=1.0.0
21
+ Requires-Dist: pyyaml>=6.0
22
+ Requires-Dist: resklogits>=0.2.0
23
+ Provides-Extra: all
24
+ Requires-Dist: datadog-api-client>=2.0; extra == 'all'
25
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'all'
26
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'all'
27
+ Requires-Dist: prometheus-client>=0.19; extra == 'all'
28
+ Provides-Extra: datadog
29
+ Requires-Dist: datadog-api-client>=2.0; extra == 'datadog'
30
+ Provides-Extra: dev
31
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
33
+ Requires-Dist: pytest>=7.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
35
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
36
+ Provides-Extra: opentelemetry
37
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'opentelemetry'
38
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'opentelemetry'
39
+ Provides-Extra: prometheus
40
+ Requires-Dist: prometheus-client>=0.19; extra == 'prometheus'
41
+ Provides-Extra: slack
42
+ Requires-Dist: httpx>=0.27.0; extra == 'slack'
43
+ Provides-Extra: webhook
44
+ Description-Content-Type: text/markdown
45
+
46
+ # ReskPoints
47
+
48
+ > **The AI Agent Logger** — track every action your agents take, with probability, parameters, and results. Ship to any platform.
49
+
50
+ [![PyPI version](https://img.shields.io/pypi/v/reskpoints.svg)](https://pypi.org/project/reskpoints/)
51
+ [![Python Versions](https://img.shields.io/pypi/pyversions/reskpoints.svg)](https://pypi.org/project/reskpoints/)
52
+ [![License](https://img.shields.io/pypi/l/reskpoints.svg)](https://github.com/Resk-Security/ReskPoints/blob/main/LICENSE)
53
+ [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
54
+
55
+ ---
56
+
57
+ You have **AI agents** making decisions — calling tools, executing code, sending messages, searching databases.
58
+ **ReskPoints** captures every action: *what* the agent did, *how confident* it was, *what parameters* it used, and *what happened*.
59
+
60
+ Pipe it to **Datadog, Prometheus, OpenTelemetry, webhooks, JSON files, or your console** — all from a single logger.
61
+
62
+ ---
63
+
64
+ ## One line, full trace
65
+
66
+ ```python
67
+ from reskpoints import AgentLogger
68
+
69
+ logger = AgentLogger()
70
+
71
+ logger.log("agent-1", "tool_call", 0.95, {"tool": "search", "query": "RAG papers"}, "3 results")
72
+ ```
73
+
74
+ Async? Same API:
75
+
76
+ ```python
77
+ await logger.alog("agent-1", "tool_call", 0.95, {"tool": "search"}, "3 results")
78
+ ```
79
+
80
+ Decorator? Wrap any function:
81
+
82
+ ```python
83
+ @log_action(agent_id="coder")
84
+ def execute_python(code: str) -> str:
85
+ ...
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Why ReskPoints?
91
+
92
+ | Problem | ReskPoints |
93
+ |---------|------------|
94
+ | **"I don't know what my agent is doing"** | Every tool call, API request, and decision is logged with full context |
95
+ | **"It's too slow to add logging"** | One decorator, one line of code. Done. |
96
+ | **"My logs go everywhere and nowhere"** | Ship to Console, File, Webhook, Datadog, Prometheus, OpenTelemetry — or all at once |
97
+ | **"Sensitive data leaks in params"** | Auto-mask api_key, token, password, and custom fields before they leave your app |
98
+ | **"I log too much / too little"** | Probabilistic sampling per action pattern (`heartbeat: 1%`, `tool_*: 100%`) |
99
+ | **"One platform going down kills my logs"** | Retry + backoff + circuit breaker + in-memory buffering |
100
+
101
+ ---
102
+
103
+ ## Install
104
+
105
+ ```bash
106
+ pip install reskpoints
107
+ pip install reskpoints[datadog,prometheus,opentelemetry] # with extras
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Features
113
+
114
+ - **AgentLogger** — sync `log()` and async `alog()` with auto-enrichment (timestamp, host, env, UUID)
115
+ - **Decorator** — `@log_action` logs every call automatically with params + result + duration
116
+ - **Sampling** — per-action probabilistic rate (`tool_call: 100%`, `heartbeat: 1%`)
117
+ - **Masking** — automatic redaction of sensitive fields (`api_key`, `token`, `password`, regex patterns)
118
+ - **7 platforms** — Console, File (JSONL), Webhook (HMAC-signed), Datadog, Prometheus, OpenTelemetry, Mock
119
+ - **Reliability** — exponential backoff retry, circuit breaker, buffering, batching
120
+ - **CLI** — `reskpoints log`, `test`, `status`, `tail`, `replay`
121
+ - **Config** — YAML-driven with `${ENV_VAR:default}` interpolation
122
+
123
+ ---
124
+
125
+ ## Platforms
126
+
127
+ | Platform | Extra | Use case |
128
+ |----------|-------|----------|
129
+ | Console | *built-in* | Dev/debug |
130
+ | File (JSONL) | *built-in* | Local storage, replay |
131
+ | Webhook | *built-in* | Custom endpoints, Zapier, N8n |
132
+ | Datadog | `[datadog]` | Datadog Logs + Metrics |
133
+ | Prometheus | `[prometheus]` | Pushgateway metrics |
134
+ | OpenTelemetry | `[opentelemetry]` | OTLP spans → any backend |
135
+ | Mock | *built-in* | Testing |
136
+
137
+ ---
138
+
139
+ ## Architecture
140
+
141
+ ```
142
+ Agent code ReskPoints Your observability stack
143
+ ─────────────────────────────────────────────────────────────────────────────────────
144
+
145
+ @log_action ┌─────────────┐ ┌──────────┐
146
+ def search(q): ───────────▶ │ Sampler │ │ Console │
147
+ ... │ (rate per │ ├──────────┤
148
+ │ action) │ │ File │
149
+ logger.log( └──────┬──────┘ ├──────────┤
150
+ agent_id="agent-1", │ │ Webhook │
151
+ action="tool_call", ┌────────▼───────┐ ├──────────┤
152
+ probability=0.95, │ FieldMasker │ │ Datadog │
153
+ params={...}, │ (auto-redact │ ├──────────┤
154
+ result="ok", │ secrets) │ │Prometheus│
155
+ ) └────────┬───────┘ ├──────────┤
156
+ │ │ OTel │
157
+ ┌───────▼────────┐ └──────────┘
158
+ │ MultiPlatform │
159
+ │ ┌──────────┐ │
160
+ │ │ retry │ │
161
+ │ │ circuit │ │
162
+ │ │ buffer │ │
163
+ │ └──────────┘ │
164
+ └────────────────┘
165
+ ```
166
+
167
+ Each platform is wrapped with retry (exp backoff), circuit breaker (5 fails → 30s recovery), and buffering (1000 entries).
168
+
169
+ ---
170
+
171
+ ## Quick tour
172
+
173
+ ```python
174
+ # Minimal
175
+ logger.log("agent-1", "search", 0.95, {"q": "papers"}, "3 results")
176
+
177
+ # Full
178
+ logger.log(
179
+ agent_id="agent-1",
180
+ action="tool_call",
181
+ probability=0.95,
182
+ params={"tool": "search", "query": "RAG papers 2025"},
183
+ result=["paper1", "paper2"],
184
+ success=True,
185
+ duration_ms=1240.5,
186
+ session_id="sess_abc123",
187
+ correlation_id="req_xyz789",
188
+ )
189
+
190
+ # Async
191
+ results = await logger.alog("agent-1", "search", 0.95, {"q": "papers"}, "3 results")
192
+
193
+ # Decorator
194
+ @log_action(agent_id="coder")
195
+ def execute_python(code: str) -> str: ...
196
+
197
+ # Check health
198
+ logger.health()
199
+ # → {"console": {"status": "ok"}, "datadog": {"status": "degraded", "error": ...}}
200
+ ```
201
+
202
+ ---
203
+
204
+ ## CLI
205
+
206
+ ```bash
207
+ reskpoints log --agent-id agent-1 --action tool_call --params '{"tool":"search"}'
208
+ reskpoints test # Test all platforms
209
+ reskpoints status # Platform health
210
+ reskpoints tail # Live log stream
211
+ reskpoints replay logs.jsonl # Replay from file
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Config (`reskpoints.yaml`)
217
+
218
+ ```yaml
219
+ agent_logger:
220
+ sampling:
221
+ default_rate: 1.0
222
+ rules:
223
+ - action: "heartbeat" rate: 0.01
224
+ - action: "tool_*" rate: 1.0
225
+ masking:
226
+ enabled: true
227
+ sensitive_fields: [api_key, token, secret, password]
228
+ platforms:
229
+ console:
230
+ enabled: true
231
+ format: "human"
232
+ webhook:
233
+ enabled: false
234
+ url: "${WEBHOOK_URL}"
235
+ signing_secret: "${WEBHOOK_SECRET}"
236
+ datadog:
237
+ enabled: false
238
+ api_key: "${DD_API_KEY}"
239
+ site: "datadoghq.eu"
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Development
245
+
246
+ ```bash
247
+ git clone https://github.com/Resk-Security/ReskPoints.git
248
+ cd ReskPoints
249
+ pip install -e ".[all,dev]"
250
+ pytest tests/ -v # 26 tests
251
+ ruff check src/ # clean
252
+ mypy src/ # passes
253
+ ```
254
+
255
+ ---
256
+
257
+ ## License
258
+
259
+ MIT. Built with [resklogits](https://github.com/Resk-Security/resk-logits).
@@ -0,0 +1,214 @@
1
+ # ReskPoints
2
+
3
+ > **The AI Agent Logger** — track every action your agents take, with probability, parameters, and results. Ship to any platform.
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/reskpoints.svg)](https://pypi.org/project/reskpoints/)
6
+ [![Python Versions](https://img.shields.io/pypi/pyversions/reskpoints.svg)](https://pypi.org/project/reskpoints/)
7
+ [![License](https://img.shields.io/pypi/l/reskpoints.svg)](https://github.com/Resk-Security/ReskPoints/blob/main/LICENSE)
8
+ [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
9
+
10
+ ---
11
+
12
+ You have **AI agents** making decisions — calling tools, executing code, sending messages, searching databases.
13
+ **ReskPoints** captures every action: *what* the agent did, *how confident* it was, *what parameters* it used, and *what happened*.
14
+
15
+ Pipe it to **Datadog, Prometheus, OpenTelemetry, webhooks, JSON files, or your console** — all from a single logger.
16
+
17
+ ---
18
+
19
+ ## One line, full trace
20
+
21
+ ```python
22
+ from reskpoints import AgentLogger
23
+
24
+ logger = AgentLogger()
25
+
26
+ logger.log("agent-1", "tool_call", 0.95, {"tool": "search", "query": "RAG papers"}, "3 results")
27
+ ```
28
+
29
+ Async? Same API:
30
+
31
+ ```python
32
+ await logger.alog("agent-1", "tool_call", 0.95, {"tool": "search"}, "3 results")
33
+ ```
34
+
35
+ Decorator? Wrap any function:
36
+
37
+ ```python
38
+ @log_action(agent_id="coder")
39
+ def execute_python(code: str) -> str:
40
+ ...
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Why ReskPoints?
46
+
47
+ | Problem | ReskPoints |
48
+ |---------|------------|
49
+ | **"I don't know what my agent is doing"** | Every tool call, API request, and decision is logged with full context |
50
+ | **"It's too slow to add logging"** | One decorator, one line of code. Done. |
51
+ | **"My logs go everywhere and nowhere"** | Ship to Console, File, Webhook, Datadog, Prometheus, OpenTelemetry — or all at once |
52
+ | **"Sensitive data leaks in params"** | Auto-mask api_key, token, password, and custom fields before they leave your app |
53
+ | **"I log too much / too little"** | Probabilistic sampling per action pattern (`heartbeat: 1%`, `tool_*: 100%`) |
54
+ | **"One platform going down kills my logs"** | Retry + backoff + circuit breaker + in-memory buffering |
55
+
56
+ ---
57
+
58
+ ## Install
59
+
60
+ ```bash
61
+ pip install reskpoints
62
+ pip install reskpoints[datadog,prometheus,opentelemetry] # with extras
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Features
68
+
69
+ - **AgentLogger** — sync `log()` and async `alog()` with auto-enrichment (timestamp, host, env, UUID)
70
+ - **Decorator** — `@log_action` logs every call automatically with params + result + duration
71
+ - **Sampling** — per-action probabilistic rate (`tool_call: 100%`, `heartbeat: 1%`)
72
+ - **Masking** — automatic redaction of sensitive fields (`api_key`, `token`, `password`, regex patterns)
73
+ - **7 platforms** — Console, File (JSONL), Webhook (HMAC-signed), Datadog, Prometheus, OpenTelemetry, Mock
74
+ - **Reliability** — exponential backoff retry, circuit breaker, buffering, batching
75
+ - **CLI** — `reskpoints log`, `test`, `status`, `tail`, `replay`
76
+ - **Config** — YAML-driven with `${ENV_VAR:default}` interpolation
77
+
78
+ ---
79
+
80
+ ## Platforms
81
+
82
+ | Platform | Extra | Use case |
83
+ |----------|-------|----------|
84
+ | Console | *built-in* | Dev/debug |
85
+ | File (JSONL) | *built-in* | Local storage, replay |
86
+ | Webhook | *built-in* | Custom endpoints, Zapier, N8n |
87
+ | Datadog | `[datadog]` | Datadog Logs + Metrics |
88
+ | Prometheus | `[prometheus]` | Pushgateway metrics |
89
+ | OpenTelemetry | `[opentelemetry]` | OTLP spans → any backend |
90
+ | Mock | *built-in* | Testing |
91
+
92
+ ---
93
+
94
+ ## Architecture
95
+
96
+ ```
97
+ Agent code ReskPoints Your observability stack
98
+ ─────────────────────────────────────────────────────────────────────────────────────
99
+
100
+ @log_action ┌─────────────┐ ┌──────────┐
101
+ def search(q): ───────────▶ │ Sampler │ │ Console │
102
+ ... │ (rate per │ ├──────────┤
103
+ │ action) │ │ File │
104
+ logger.log( └──────┬──────┘ ├──────────┤
105
+ agent_id="agent-1", │ │ Webhook │
106
+ action="tool_call", ┌────────▼───────┐ ├──────────┤
107
+ probability=0.95, │ FieldMasker │ │ Datadog │
108
+ params={...}, │ (auto-redact │ ├──────────┤
109
+ result="ok", │ secrets) │ │Prometheus│
110
+ ) └────────┬───────┘ ├──────────┤
111
+ │ │ OTel │
112
+ ┌───────▼────────┐ └──────────┘
113
+ │ MultiPlatform │
114
+ │ ┌──────────┐ │
115
+ │ │ retry │ │
116
+ │ │ circuit │ │
117
+ │ │ buffer │ │
118
+ │ └──────────┘ │
119
+ └────────────────┘
120
+ ```
121
+
122
+ Each platform is wrapped with retry (exp backoff), circuit breaker (5 fails → 30s recovery), and buffering (1000 entries).
123
+
124
+ ---
125
+
126
+ ## Quick tour
127
+
128
+ ```python
129
+ # Minimal
130
+ logger.log("agent-1", "search", 0.95, {"q": "papers"}, "3 results")
131
+
132
+ # Full
133
+ logger.log(
134
+ agent_id="agent-1",
135
+ action="tool_call",
136
+ probability=0.95,
137
+ params={"tool": "search", "query": "RAG papers 2025"},
138
+ result=["paper1", "paper2"],
139
+ success=True,
140
+ duration_ms=1240.5,
141
+ session_id="sess_abc123",
142
+ correlation_id="req_xyz789",
143
+ )
144
+
145
+ # Async
146
+ results = await logger.alog("agent-1", "search", 0.95, {"q": "papers"}, "3 results")
147
+
148
+ # Decorator
149
+ @log_action(agent_id="coder")
150
+ def execute_python(code: str) -> str: ...
151
+
152
+ # Check health
153
+ logger.health()
154
+ # → {"console": {"status": "ok"}, "datadog": {"status": "degraded", "error": ...}}
155
+ ```
156
+
157
+ ---
158
+
159
+ ## CLI
160
+
161
+ ```bash
162
+ reskpoints log --agent-id agent-1 --action tool_call --params '{"tool":"search"}'
163
+ reskpoints test # Test all platforms
164
+ reskpoints status # Platform health
165
+ reskpoints tail # Live log stream
166
+ reskpoints replay logs.jsonl # Replay from file
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Config (`reskpoints.yaml`)
172
+
173
+ ```yaml
174
+ agent_logger:
175
+ sampling:
176
+ default_rate: 1.0
177
+ rules:
178
+ - action: "heartbeat" rate: 0.01
179
+ - action: "tool_*" rate: 1.0
180
+ masking:
181
+ enabled: true
182
+ sensitive_fields: [api_key, token, secret, password]
183
+ platforms:
184
+ console:
185
+ enabled: true
186
+ format: "human"
187
+ webhook:
188
+ enabled: false
189
+ url: "${WEBHOOK_URL}"
190
+ signing_secret: "${WEBHOOK_SECRET}"
191
+ datadog:
192
+ enabled: false
193
+ api_key: "${DD_API_KEY}"
194
+ site: "datadoghq.eu"
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Development
200
+
201
+ ```bash
202
+ git clone https://github.com/Resk-Security/ReskPoints.git
203
+ cd ReskPoints
204
+ pip install -e ".[all,dev]"
205
+ pytest tests/ -v # 26 tests
206
+ ruff check src/ # clean
207
+ mypy src/ # passes
208
+ ```
209
+
210
+ ---
211
+
212
+ ## License
213
+
214
+ MIT. Built with [resklogits](https://github.com/Resk-Security/resk-logits).
@@ -0,0 +1,85 @@
1
+ [project]
2
+ name = "reskpoints"
3
+ version = "0.1.0"
4
+ description = "Agent Action Logging Platform — log all AI/LLM agent actions to any platform"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.10"
8
+ authors = [{name = "RESK Security"}]
9
+ keywords = ["agent", "llm", "ai", "logging", "monitoring", "observability"]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "Intended Audience :: Developers",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Programming Language :: Python :: 3",
15
+ "Topic :: System :: Monitoring",
16
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
17
+ ]
18
+
19
+ dependencies = [
20
+ "resklogits>=0.2.0",
21
+ "pyyaml>=6.0",
22
+ "httpx>=0.27.0",
23
+ "pydantic>=2.0.0",
24
+ "python-dotenv>=1.0.0",
25
+ ]
26
+
27
+ [project.optional-dependencies]
28
+ all = ["reskpoints[webhook,datadog,prometheus,opentelemetry]"]
29
+ webhook = []
30
+ datadog = ["datadog-api-client>=2.0"]
31
+ prometheus = ["prometheus-client>=0.19"]
32
+ opentelemetry = ["opentelemetry-api>=1.20", "opentelemetry-sdk>=1.20"]
33
+ slack = ["httpx>=0.27.0"]
34
+ dev = [
35
+ "pytest>=7.0",
36
+ "pytest-asyncio>=0.23",
37
+ "ruff>=0.1.0",
38
+ "mypy>=1.0.0",
39
+ "types-PyYAML>=6.0",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/Resk-Security/ReskPoints"
44
+ Repository = "https://github.com/Resk-Security/ReskPoints"
45
+
46
+ [project.scripts]
47
+ reskpoints = "reskpoints.cli:main"
48
+
49
+ [build-system]
50
+ requires = ["hatchling"]
51
+ build-backend = "hatchling.build"
52
+
53
+ [tool.hatch.build.targets.wheel]
54
+ packages = ["src/reskpoints"]
55
+ include = [
56
+ "/src/reskpoints/**/*.py",
57
+ "/src/reskpoints/py.typed",
58
+ "reskpoints.yaml",
59
+ ]
60
+
61
+ [tool.hatch.build.targets.sdist]
62
+ include = [
63
+ "/src",
64
+ "/README.md",
65
+ "/LICENSE",
66
+ "/pyproject.toml",
67
+ "/reskpoints.yaml",
68
+ ]
69
+
70
+ [tool.pytest.ini_options]
71
+ testpaths = ["tests"]
72
+ asyncio_mode = "auto"
73
+
74
+ [tool.ruff]
75
+ line-length = 100
76
+ target-version = "py310"
77
+
78
+ [tool.ruff.lint]
79
+ select = ["E", "W", "F", "I", "B", "C4"]
80
+ ignore = ["E501", "B008"]
81
+
82
+ [tool.mypy]
83
+ python_version = "3.10"
84
+ warn_return_any = true
85
+ disallow_untyped_defs = false
@@ -0,0 +1,67 @@
1
+ agent_logger:
2
+ environment: "${ENV:development}"
3
+
4
+ masking:
5
+ enabled: true
6
+ sensitive_fields:
7
+ - api_key
8
+ - password
9
+ - token
10
+ - secret
11
+ - authorization
12
+ - auth_token
13
+ - access_token
14
+ - refresh_token
15
+ - private_key
16
+ - session_id
17
+
18
+ sampling:
19
+ default_rate: 1.0
20
+ rules:
21
+ - action: "heartbeat"
22
+ rate: 0.01
23
+ - action: "status_check"
24
+ rate: 0.05
25
+ - action: "tool_*"
26
+ rate: 1.0
27
+ - action: "message_*"
28
+ rate: 0.5
29
+
30
+ buffering:
31
+ max_size: 1000
32
+ flush_interval: 5.0
33
+
34
+ retry:
35
+ max_attempts: 3
36
+ backoff: [0.5, 1.5, 4.5]
37
+ circuit_breaker:
38
+ threshold: 5
39
+ recovery_time: 30
40
+
41
+ platforms:
42
+ console:
43
+ enabled: true
44
+ format: "human"
45
+
46
+ webhook:
47
+ enabled: false
48
+ url: "${WEBHOOK_URL}"
49
+ signing_secret: "${WEBHOOK_SECRET}"
50
+ timeout: 10.0
51
+
52
+ file:
53
+ enabled: false
54
+ path: "/var/log/agent_actions.jsonl"
55
+
56
+ datadog:
57
+ enabled: false
58
+ api_key: "${DD_API_KEY}"
59
+ site: "datadoghq.eu"
60
+ tags:
61
+ team: "resk"
62
+ project: "reskpoints"
63
+
64
+ prometheus:
65
+ enabled: false
66
+ pushgateway_url: "http://localhost:9091"
67
+ job_name: "agent_actions"
@@ -0,0 +1,29 @@
1
+ from .agent_logger import AgentLogger
2
+ from .config import AgentLoggerConfig
3
+ from .decorator import log_action
4
+ from .masking import FieldMasker
5
+ from .models import ActionLog, LogResult
6
+ from .platforms import (
7
+ BasePlatform,
8
+ ConsolePlatform,
9
+ FilePlatform,
10
+ MockPlatform,
11
+ WebhookPlatform,
12
+ )
13
+
14
+ __version__ = "0.1.0"
15
+ __author__ = "RESK Security"
16
+
17
+ __all__ = [
18
+ "AgentLogger",
19
+ "AgentLoggerConfig",
20
+ "log_action",
21
+ "FieldMasker",
22
+ "ActionLog",
23
+ "LogResult",
24
+ "BasePlatform",
25
+ "ConsolePlatform",
26
+ "FilePlatform",
27
+ "MockPlatform",
28
+ "WebhookPlatform",
29
+ ]