@@ -109,6 +109,7 @@ Features have unique storage keys and can intercept agent lifecycle events.
109109The framework provides comprehensive testing utilities in ` agents-test ` module:
110110
111111### LLM Response Mocking
112+
112113``` kotlin
113114val mockLLMApi = getMockExecutor(toolRegistry, eventHandler) {
114115 mockLLMAnswer(" Hello!" ) onRequestContains " Hello"
@@ -118,6 +119,7 @@ val mockLLMApi = getMockExecutor(toolRegistry, eventHandler) {
118119```
119120
120121### Tool Behavior Mocking
122+
121123``` kotlin
122124// Simple return value
123125mockTool(PositiveToneTool ) alwaysReturns " The text has a positive tone."
@@ -129,25 +131,26 @@ mockTool(NegativeToneTool) alwaysTells {
129131}
130132
131133// Conditional responses
132- mockTool(SearchTool ) returns SearchTool .Result (" Found" ) onArgumentsMatching {
133- args.query.contains(" important" )
134+ mockTool(SearchTool ) returns SearchTool .Result (" Found" ) onArgumentsMatching {
135+ args.query.contains(" important" )
134136}
135137```
136138
137139### Graph Structure Testing
140+
138141``` kotlin
139142AIAgent (.. .) {
140143 withTesting()
141-
144+
142145 testGraph(" test" ) {
143146 val firstSubgraph = assertSubgraphByName<String , String >(" first" )
144147 val secondSubgraph = assertSubgraphByName<String , String >(" second" )
145-
148+
146149 assertEdges {
147150 startNode() alwaysGoesTo firstSubgraph
148151 firstSubgraph alwaysGoesTo secondSubgraph
149152 }
150-
153+
151154 verifySubgraph(firstSubgraph) {
152155 val askLLM = assertNodeByName<String , Message .Response >(" callLLM" )
153156 assertNodes {
@@ -163,24 +166,27 @@ For comprehensive testing examples, see `agents/agents-test/TESTING.md`.
163166## Security
164167
165168### API Key Management
169+
166170- ** NEVER** commit API keys or secrets to the repository
167171- Use environment variables for all sensitive configuration
168172- Store test API keys in a local environment only
169173- Required environment variables for integration tests:
170- - ` ANTHROPIC_API_TEST_KEY `
171- - ` GEMINI_API_TEST_KEY `
172- - ` MISTRAL_AI_API_TEST_KEY `
173- - ` OLLAMA_IMAGE_URL `
174- - ` OPEN_AI_API_TEST_KEY `
175- - ` OPEN_ROUTER_API_TEST_KEY `
174+ - ` ANTHROPIC_API_TEST_KEY `
175+ - ` GEMINI_API_TEST_KEY `
176+ - ` MISTRAL_AI_API_TEST_KEY `
177+ - ` OLLAMA_IMAGE_URL `
178+ - ` OPEN_AI_API_TEST_KEY `
179+ - ` OPEN_ROUTER_API_TEST_KEY `
176180
177181### Tool Execution Safety
182+
178183- Tools execute within controlled ` AIAgentEnvironment ` contexts
179184- Direct tool calls are prevented outside agent execution
180185- Use type-safe tool arguments to prevent injection attacks
181186- Validate all external inputs in tool implementations
182187
183188### Dependency Security
189+
184190- Regularly update dependencies using Gradle version catalogs
185191- Use specific version ranges to avoid supply chain attacks
186192- Review dependencies for known vulnerabilities
@@ -189,7 +195,9 @@ For comprehensive testing examples, see `agents/agents-test/TESTING.md`.
189195## Configuration
190196
191197### Environment Setup
198+
192199Set environment variables for integration testing (never commit API keys):
200+
193201``` bash
194202# Export in your shell or IDE run configuration
195203export ANTHROPIC_API_TEST_KEY=your_key_here
@@ -204,31 +212,36 @@ export OPEN_ROUTER_API_TEST_KEY=your_key_here
204212```
205213
206214### Gradle Configuration
215+
207216- Uses version catalogs (` gradle/libs.versions.toml ` ) for dependency management
208217- Multiplatform configuration in ` build.gradle.kts `
209218- Test configuration supports both JVM and JS targets
210219
211220### Development Environment Requirements
221+
212222- ** JDK** : 17+ (OpenJDK recommended)
213223- ** IDE** : IntelliJ IDEA with Kotlin Multiplatform plugin
214224- ** Optional** : Docker for Ollama local testing
215225
216226## Development Workflow
217227
218228### Branch Strategy
229+
219230- ** develop** : All development (features and bug fixes)
220- - ** main** : Released versions only
231+ - ** main** : Released versions only
221232- Base all PRs against ` develop ` branch
222233- Use descriptive branch names: ` feature/agent-memory ` , ` fix/tool-registry-bug `
223234
224235### Code Quality
236+
225237- ** ALWAYS** run ` ./gradlew build ` before submitting PRs
226238- Ensure all tests pass on JVM, JS, WASM targets
227239- Follow established patterns in existing code
228240- Add tests for new functionality
229241- Update documentation for API changes
230242
231243### Commit Guidelines
244+
232245- Use conventional commit format: ` feat: ` , ` fix: ` , ` docs: ` , ` test: `
233246- Include issue references where applicable
234247- Keep commits focused and atomic
0 commit comments