Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Fuel Agent Kit

## Overview
Fuel Agent Kit is an agentic framework designed to enhance the capabilities of the Fuel Network. It provides tools, libraries, and infrastructure to build, deploy, and manage intelligent agents that can interact with the Fuel Network ecosystem.

## Prerequisites
Before you begin, ensure you have the following installed on your system:

- **Fuel Toolchain**: The Fuel development environment and toolchain.
- **Node.js**: Version 16 or higher for building and running agent applications.

## Installation

1. **Clone the Repository**:
```bash
git clone https://github.com/priyanshudumps/fuel-agent-kit.git
cd fuel-agent-kit
```

2. **Install Dependencies**:
```bash
npm install
```

3. **Set Up Environment**:
Configure your environment variables as specified in the `.env.example` file.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
126 changes: 126 additions & 0 deletions docs/security/wallet-safety.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@

# Wallet Security Guide for Fuel Agent Kit

This guide provides best practices for securely handling wallet-related operations in the Fuel Agent Kit.

## Storing Mnemonics

Mnemonics (seed phrases) are the foundation of your wallet security. Follow these guidelines:

### Never Hardcode Mnemonics
- **Never** store mnemonics directly in your codebase or configuration files
- Mnemonics should never be committed to version control
- Use environment variables or secure secret management systems instead

### Secure Storage Options
1. **Environment Variables**: Store mnemonics in environment variables
```bash
export WALLET_MNEMONIC="your-mnemonic-here"
```
Then access them in your code:
```typescript
const mnemonic = process.env.WALLET_MNEMONIC;
```

2. **Secret Management Services**: Use services like:
- AWS Secrets Manager
- HashiCorp Vault
- Azure Key Vault
- GitHub Secrets (for CI/CD environments)

3. **Encrypted Files**: If you must store mnemonics locally:
- Use strong encryption (AES-256)
- Store encryption keys separately
- Keep the encrypted file outside your codebase

## Handling Private Keys

Private keys are the most sensitive component of your wallet. Follow these strict guidelines:

### Never Hardcode Private Keys
- **Never** embed private keys in your source code
- **Never** commit private keys to version control
- **Never** log or print private keys in development environments

### Secure Private Key Management
1. **Environment Variables**: Store private keys in environment variables
```typescript
const privateKey = process.env.PRIVATE_KEY;
```

2. **Temporary Storage**: For production environments:
- Use short-lived credentials
- Implement proper key rotation
- Use hardware security modules (HSMs) when possible

3. **Key Derivation**: For derived keys:
- Use strong key derivation functions (like PBKDF2, Argon2)
- Never use weak derivation methods
- Always use appropriate iteration counts

## Best Practices for Agent Logic

### Input Validation
- Always validate all wallet-related inputs
- Never trust user-provided wallet addresses or public keys
- Implement proper error handling for invalid inputs

### Secure Transactions
- Never sign transactions with hardcoded keys
- Always verify transaction signatures
- Implement proper gas limit calculations
- Use transaction simulation before execution

### Logging and Monitoring
- Never log private keys or sensitive transaction data
- Implement proper logging levels (avoid logging sensitive information at debug level)
- Set up monitoring for suspicious wallet activities
- Use secure logging mechanisms that don't expose sensitive data

## Development Security Checklist

Before deploying any wallet-related functionality:

1. [ ] All mnemonics and private keys are stored securely (not in code)
2. [ ] Environment variables are properly secured (not committed to version control)
3. [ ] All sensitive data is properly encrypted at rest
4. [ ] Input validation is implemented for all wallet operations
5. [ ] No sensitive data is logged or exposed in error messages
6. [ ] Proper error handling prevents information leakage
7. [ ] All dependencies are up-to-date and secure
8. [ ] Code has been reviewed for security vulnerabilities

## Example: Secure Wallet Initialization

```typescript
// Secure wallet initialization example
function initializeWallet() {
// Load from environment variables
const mnemonic = process.env.WALLET_MNEMONIC;
const privateKey = process.env.PRIVATE_KEY;

if (!mnemonic || !privateKey) {
throw new Error("Wallet credentials not properly configured");
}

// Validate credentials before use
if (mnemonic.length < 12 || privateKey.length < 64) {
throw new Error("Invalid wallet credentials");
}

// Initialize wallet with secure context
const wallet = new Wallet({
mnemonic,
privateKey,
network: process.env.NETWORK || "mainnet"
});

return wallet;
}
```

## Additional Resources

- [Fuel Wallet Documentation](https://docs.fuel.sh/)
- [Secure Coding Practices](https://cheatsheetseries.owasp.org/cheatsheets/Secure_Coding_Practices_Cheat_Sheet.html)
- [OWASP Wallet Security Guide](https://cheatsheetseries.owasp.org/cheatsheets/Wallet_Security_Cheat_Sheet.html)
49 changes: 49 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Fuel Agent Kit - Python Implementation

Fuel Agent Kit provides tools for building and managing fuel agents in Python.

## Prerequisites

- Python 3.10 or higher
- pip package manager

## Installation

Install the Fuel Agent Kit using pip:

```bash
pip install fuel-agent-kit
```

## Quick Start

Here's how to initialize a basic Fuel Agent:

```python
from fuel_agent import FuelAgent

# Initialize a new Fuel Agent
agent = FuelAgent(
agent_id="my_agent_123",
name="My Fuel Agent",
description="A sample fuel agent implementation"
)

# Start the agent
agent.start()

# Stop the agent when done
agent.stop()
```

## Features

- Fuel agent management
- Configuration and initialization
- Integration with fuel infrastructure
- Extensible architecture for custom agents

## Documentation

For more detailed documentation and API reference, please visit our [official documentation](https://fuel-agent-kit.org/docs).